Hello
I have some question to ask about date filter how can I try to change type that get from grok to date
(input) :
notBefore=Nov 10 00:00:00 2015 GMT notAfter=Nov 28 23:59:59 2016 GMT issuer= /C=US/O=SSS/OU=STT/CN=Symantec Class 3 EV SSL CA - G3 subject= /1asdasdasdasdasdasd.Com
my logstash conf file is looked like this
input {
file {
path => "/opt/log/*.log"
start_position => beginning
sincedb_path => "/dev/null"
}
}
filter {
grok {
match => { "message" => "(?m)notBefore=%{DATA:Before} notAfter=%{DATA:After} issuer= /%{DATA:issuer}subject= /%{GREEDYDATA:subject}" }
}
date {
locale => en
match => [ "Before", "MMM dd HH:mm:ss yyyy z"]
}
}
output {
elasticsearch { hosts => ["192.168.100.141:9200"]
}
stdout {}
}
But I cant see any data come to elasticsearch and when I try delete data filter it works fine
Forget about Elasticsearch for now. Comment out your elasticsearch output and make this your only output: stdout { codec => rubydebug }
. Try again. What do you get?
Do note that the date filter can't parse timezone names, i.e. it won't be able to parse "GMT".
I just notice that date filter is not working as I always think so I need to apply target in date filter
now I try use new logstash conf
input {
file {
path => "/opt/log/*.log"
start_position => beginning
sincedb_path => "/dev/null"
}
}
filter {
grok {
match => { "message" => "(?m)notBefore=%{DATA:Before} GMT notAfter=%{DATA:After} GMT issuer= /%{DATA:issuer}subject= /%{GREEDYDATA:subject}" }
}
date {
locale => en
match => [ "Before", "MMM dd HH:mm:ss yyyy"]
target => "Before"
}
}
output {
elasticsearch { hosts => ["192.168.100.141:9200"]
}
stdout { codec => rubydebug }
}
And it's work ! so I want to ask more about how can I apply to multiple target (like Before/After) and why when I go to kibana logstash field I still see Before as String not date
how can I apply to multiple target (like Before/After)
Use multiple date filters.
and why when I go to kibana logstash field I still see Before as String not date
Probably because the field already had been mapped as a string. Mappings of fields can't be changed without reindexing.
Thank you very much! I am very appreciated for your support!