HI,
LOGS:
[2017-01-14 10:48:06,848][WARN ][index.search.slowlog.query] [yaswanth] [bank][0] took[27.8ms], took_millis[27], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[5], source[], extra_source[],
[2017-01-14 10:48:06,851][WARN ][index.search.slowlog.query] [yaswanth] [bank][3] took[33.7ms], took_millis[33], types[], stats[], search_type[QUERY_THEN_FETCH], total_shards[5], source[], extra_source[],
I am trying to get the logs whose TOOK field is >15ms . I used the below config
input {
file {
path => "C:\Users\571952\Desktop\pica.txt"
start_position => "beginning"
}
}
filter {
grok {
match => [ "message",
"\[%{TIMESTAMP_ISO8601:TIMESTAMP}\]\[%{LOGLEVEL:LEVEL}%{SPACE}\]\[%{DATA:QUERY}\]%{SPACE}\[%{DATA:QUE
RY1}\]%{SPACE}\[%{DATA:INDEX-NAME}\]\[%{DATA:SHARD}\]%{SPACE}took\[%{DATA:TOOK}\],%{SPACE}
took_millis\[%{DATA:TOOKM}\], types\[%{DATA:types}\], stats\[%{DATA:stats}\], search_type
\[%{DATA:search_type}\], total_shards\[%{NUMBER:total_shards}\], source\[%{DATA:source_query}\],
extra_source\[%{DATA:extra_source}\],"]
}
if [TOOK] > 15ms {
mutate {
add_tag => "slowresponse"
}
} else {
drop { }
}
}
output {
stdout { codec => rubydebug }
}
I am getting error like this:
←[31mfetched an invalid config {:config=>"input {\n file {\n path => \"C:\\U
sers\\571952\\Desktop\\pica.txt\"\n start_position => \"beginning\"\n }\n}\n
\nfilter {\n grok {\n match => [ \"message\", \"\\[%{TIMESTAMP_ISO8601:
TIMESTAMP}\\]\\[%{LOGLEVEL:LEVEL}%{SPACE}\\]\\[%{DATA:QUERY}\\]%{SPACE}\\[%{DATA
:QUERY1}\\]%{SPACE}\\[%{DATA:INDEX-NAME}\\]\\[%{DATA:SHARD}\\]%{SPACE}took\\[%{D
ATA:TOOK}\\],%{SPACE}took_millis\\[%{DATA:TOOKM}\\], types\\[%{DATA:types}\\], s
tats\\[%{DATA:stats}\\], search_type\\[%{DATA:search_type}\\], total_shards\\[%{
Even i tried with removing ms
Thanks