Last active
April 1, 2017 16:36
-
-
Save sjmach/81514d24ec7aee4627a30888209a4352 to your computer and use it in GitHub Desktop.
Logstash config file
This file contains 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
input { | |
stdin { | |
type => "stdin-type" | |
} | |
file { | |
#Replace the path | |
path => ["XXXXXXXXX/logging.log"] | |
# Make logstash read from start of file | |
start_position => "beginning" | |
sincedb_path => "/dev/null" | |
} | |
} | |
filter { | |
csv { | |
#CSV fields that we want mapped to an Index | |
columns => ["logdate","Url","Code","Result"] | |
separator => "," | |
} | |
date { | |
# Match the Date format | |
match => ["logdate","yyyy-MM-dd;HH:mm:ss:SSSZ"] | |
timezone => "Asia/Kolkata" | |
target => "@timestamp" | |
} | |
} | |
output { | |
elasticsearch { hosts => localhost} | |
if "FAIL" in [message] { | |
email { | |
port => "587" | |
address => "smtp.gmail.com" | |
username => "XXXXXXXXX" | |
password => "XXXXXXXXX" | |
authentication => "plain" | |
use_tls => true | |
from => "XXXXXXXXX" | |
subject => "Stream down alert : %{message} " | |
to => "XXXXXXXXX" | |
cc => "XXXXXXXXX" | |
via => "smtp" | |
body => "The stream that failed: %{message}" | |
} | |
} | |
stdout { codec => rubydebug } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment