Skip to content

Instantly share code, notes, and snippets.

@bhatikuldeep
Created February 26, 2019 08:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhatikuldeep/f3e27d93c3e7f0eab27ebfa137c53abd to your computer and use it in GitHub Desktop.
Save bhatikuldeep/f3e27d93c3e7f0eab27ebfa137c53abd to your computer and use it in GitHub Desktop.
Sample Logstash Configuration File - to log messages from Apigee Edge to ELK stack
input {
tcp {
port => 5044
type => syslog
}
}
filter {
mutate {
gsub => [
"message", "[\u0000]", ""
]
remove_field => ["timestamp", "host", "facility_label", "severity_label", "severity", "facility", "priority"]
}
grok {
match => {"message" => "<%{NUMBER:priority_index}>%{DATESTAMP_OTHER:apigeeTimestamp}%{LOGLEVEL}: %{GREEDYDATA:apigeeMessage}"}
remove_field => ["message"]
}
json {
source => "apigeeMessage"
target => "message"
remove_field => ["apigeeMessage"]
}
}
output {
#added below line to see how the message is outputed/parsed with logstash filer, you can remove below line (only stdout { codec => rubydebug }), if necessary.
stdout { codec => rubydebug }
elasticsearch {
hosts => ["http://localhost:9200"]
index => "apigee-%{+YYYY.MM.dd}"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment