Commit edec20f0 authored by William Tucker's avatar William Tucker
Browse files

Updated logstash configuration to fix payload problem

parent 48ba2d33
Loading
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -57,12 +57,18 @@ filter {
        replace => { "host" => "${EXTERNAL_HOSTNAME}" }
        # Move the country code to the top-level
        add_field => { "country_code" => "%{[geoip][country_code2]}" }
        # Remove any unrequired fields
        remove_field => ["client_ip", "command", "geoip", "tags", "user"]
        # Construct a new message string
        add_field => {
            "rabbitmq_message" => '%{country_code} - - [%{request_time}] "%{method} %{request} HTTP/%{http_version}" %{status_code} %{bytes_sent} "%{referrer}" "%{user_agent}" "%{client_ip}" [%{request_duration}]'
        }
    }
    mutate {
        # For Rabbit queue compatibility
        add_field => {
            "rabbitmq_payload" => '{ "properties": { "delivery_mode": 2 }, "routing_key": "log_queue", "payload": "%{message}", "payload_encoding": "string" }'
            "rabbitmq_payload" => '{ "properties": { "delivery_mode": 2 }, "routing_key": "log_queue", "payload": "%{rabbitmq_message}", "payload_encoding": "string" }'
        }
        # Remove any unrequired fields
        remove_field => ["rabbitmq_message", "command", "geoip", "tags", "user", "country_code", "request_time", "method", "request", "http_version", "status_code", "bytes_sent", "referrer", "user_agent", "client_ip", "request_duration"]
    }
}
output {
+2 −1
Original line number Diff line number Diff line
@@ -264,7 +264,8 @@ data:
      # The default server is the CMCC server
      # Your IP must be whitelisted in order to send data to the CMCC service
      url: https://esgf-logstash.cmcc.it/api/exchanges/%2f/log_exchange/publish
      authorizationKey: 
      authorizationKey: ""
      certificate: ""

  # Configuration for the THREDDS pod
  thredds: