Tag: config

logstash test config

Logstash Test Config File

##/opt/mohan/mytest.conf
input{
 stdin {}
}
filter {
## You can drive here
# My Test 
 json {
  source => "message"
 }
}
output {
 stdout {
  codec => rubydebug
 }
}

How to execute?

/opt/logstash241/bin/logstash -f /opt/mohan/mytest.conf < mydata.json

 

Advertisements

how to test logstash config

How do test logstash config?

$ cat test.config
input {
stdin { }
}
output {
stdout {
codec => rubydebug }
}
filter {
date {
match => [“message”, “dd/MM/YYYY HH.mm.ss”]
}
}

$ echo ’12/28/2016 10.50.11′ | /opt/logstash/bin/logstash -f test.config
{
“message” => “12/28/2016 10.50.11”,
“@version” => “1”,
“@timestamp” => “2016-12-28T10:50:11.000Z”,
“host” => “mydearhost”
}