Hi All,
Sorry i'm new on ELK, currently i'm use ELK 6.8.10, it's working properly, with filter by tags,
this is my grok.
filter {
if "nameservice-out-staging" in [tags] {
grok {
match => { "message" => "%{WORD:type}\]\[METHOD\]%{WORD:method}\[URL\]%{URIPATHPARAM:url}\[STATUS\]%{NUMBER:respone}\[RESPONSE_TIME\]%{NUMBER:response_time}" }
remove_field => [ "message","@version","beat","offset","prospector","log","fields" ]
}
mutate {
convert => {
"resspone" => "integer"
"response_time" => "float"
}
}
}
}
output {
if "nameservice-out-staging" in [tags] {
elasticsearch { hosts => ["ES-HOST:9200"]
hosts => "ES-HOST:9200"
manage_template => false
index => "nameservice-stage-%{+YYYY.MM.dd}"
}
}
}
it's working, but i want to change nameservice-out-staging to by source like
if [source] =~ /\/var\/log\/.pm2\/logs\/nameservice-out.log\// {
this is not working,
if [source] =~ /\/var\/log\/.pm2\/logs\/nameservice-out.log\// {
what is wrong in this regex ?
Thanks