Sha256: 827298fa5a3b18912b773e175b37882d4792235ab811f31fb5e5e914d34114b3

Contents?: true

Size: 726 Bytes

Versions: 59

Compression:

Stored size: 726 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.sanitize(val)
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
appsignal-1.1.9 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.9.beta.2 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.9.beta.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.8 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.2.0.alpha.3 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.7 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.2.0.alpha.2 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.7.beta.2 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.2.0.alpha.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.7.beta.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.6 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.6.beta.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.5 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.5.beta.4 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.5.beta.3 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.5.beta.2 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.5.beta.1 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.4 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.4.beta.3 lib/appsignal/event_formatter/elastic_search/search_formatter.rb
appsignal-1.1.4.beta.2 lib/appsignal/event_formatter/elastic_search/search_formatter.rb