Sha256: b5f7dc2b95073631b6b3c60b1811bd1618fcc5840d86a8bcd6ab30f066f557c3

Contents?: true

Size: 748 Bytes

Versions: 27

Compression:

Stored size: 748 Bytes

Contents

module Appsignal
  class EventFormatter
    module ElasticSearch
      class SearchFormatter < Appsignal::EventFormatter
        register 'search.elasticsearch'

        def format(payload)
          [
            "#{payload[:name]}: #{payload[:klass]}",
            sanitized_search(payload[:search]).inspect
          ]
        end

        def sanitized_search(search)
          return nil unless search.is_a?(Hash)
          {}.tap do |hsh|
            search.each do |key, val|
              if [:index, :type].include?(key)
                hsh[key] = val
              else
                hsh[key] = Appsignal::Utils::QueryParamsSanitizer.sanitize(val)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
appsignal-2.0.6 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.0.5 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.0.5.beta.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.1.0.alpha.3 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.1.0.alpha.2 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.1.0.alpha.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.0.4 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.0.3 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.0.2 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.0.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.0.0 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-2.0.0.beta.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.4.0.beta.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.3.6 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.3.6.beta.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.3.5 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.3.5.beta.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.3.4 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.3.3 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.4.0.alpha.2 lib/appsignal/event_formatter/elastic_search/search_formatter.rb