Last active
November 26, 2017 19:54
-
-
Save ayseff/0c65c8b228d6ee5d54bb0bffe3174c28 to your computer and use it in GitHub Desktop.
Logstash Config File for Processing Data from Syslog
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # this file needs to be put on the ELK server at: /etc/logstash/conf.d/logstash.conf | |
| # for more info, see https://www.digitalocean.com/community/tutorials/how-to-centralize-logs-with-rsyslog-logstash-and-elasticsearch-on-ubuntu-14-04 | |
| # This input block will listen on port 514 for logs to come in. | |
| # host should be an IP on the Logstash server. | |
| # codec => "json" indicates that we expect the lines we're receiving to be in JSON format | |
| # type => "rsyslog" is an optional identifier to help identify messaging streams in the pipeline. | |
| input { | |
| udp { | |
| host => "logstash_private_ip" | |
| port => 514 | |
| codec => "json" | |
| type => "rsyslog" | |
| } | |
| } | |
| # This is an empty filter block. You can later add other filters here to further process | |
| # your log lines | |
| filter { } | |
| # This output block will send all events of type "rsyslog" to Elasticsearch at the configured | |
| # host and port into daily indices of the pattern, "rsyslog-YYYY.MM.DD" | |
| output { | |
| if [type] == "rsyslog" { | |
| elasticsearch { | |
| hosts => [ "elasticsearch_private_ip:9200" ] | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment