Skip to content

Instantly share code, notes, and snippets.

@dvas0004
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dvas0004/f4f597bebf8c79af6fe3 to your computer and use it in GitHub Desktop.
Save dvas0004/f4f597bebf8c79af6fe3 to your computer and use it in GitHub Desktop.
sample logstash configuration file
input {
tcp {
port => 5140
type => "windows-events"
codec => json {
charset => "CP1252"
}
}
tcp {
port => 5141
type => "ossec-events"
codec => json {
charset => "CP1252"
}
}
syslog {
type => "syslog"
}
}
filter {
mutate {
add_field => { "Sender_IP" => "%{host}" }
}
if [type] == "windows-events" {
if [Message] =~ "My first log .*"{
grok {
match => [ "Message", 'My first log %{GREEDYDATA:custom_message}' ]
add_tag => ["grokked"]
}
}
date {
match => ["[EventTime]", "YYYY-MM-dd HH:mm:ss"]
}
}
if [type] == "ossec-events" {
grok {
add_tag => ["AlienVault"]
}
}
}
output {
stdout { }
elasticsearch {
host => "localhost"
template => "/callHome/logstash-1.4.2/lib/logstash/outputs/elasticsearch/elasticsearch-template.json"
template_overwrite => true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment