Hi Everyone,
I need to extract directory name from the "path" field and assign it to "arcot" field. I require "arcot" value for filtering purpose. Below is the code i am using. path variable is storing "D:\Program Files (x86)\Arcot Systems1\logs\arcotriskfort.log" i am extracting "Arcot Systems1" into variable "arcot" and getting below error,
Please note: I am a beginner in ELK
Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, {, ,, ] at line 18, column 17
input
{
file
{
path => ["D:\Program Files (x86)\Arcot Systems1\logs\arcotriskfort.log"]
start_position => "beginning"
}
}
filter
{
grok
{
match => ["message","%{SYSLOGTIMESTAMP:timestamp} %{NUMBER:year} %{LOGLEVEL:level}%{GREEDYDATA}RT=%{NUMBER:RT},Q1T=%{NUMBER:Q1T},PT=%{NUMBER:PT},PPT=%{NUMBER:PPT},APT=%{NUMBER:APT},MT=%{NUMBER:MT},Q2T=%{NUMBER:Q2T},DT=%{NUMBER:DT}"]
match => ["path","\\[^\\]+\\\\(?<arcot>[^\\]+)\\"]
}
mutate
{
convert => { "DT" => "integer" }
convert => { "Q1T" => "integer" }
convert => { "APT" => "integer" }
convert => { "RT" => "integer" }
}
}
output
{
stdout { codec => rubydebug }
elasticsearch
{
#host => "localhost"
#protocol => "http"
#cluster => "elasticsearch"
index => "newfrm"
template => "D:\Program Files (x86)\abc.txt"
template_name => "newfrm"
template_overwrite => true
}
}