Hi,
I hava many input file in my configuration file, like this:
file {
path => "/root/elasticsearch/test-logs/log-node1.log"
type => "apache"
}
file {
path => "/root/elasticsearch/test-logs/log-node2.log"
type => "apache"
}
file {
path => "/root/elasticsearch/test-logs/log-node3.log"
type => "apache"
}
file {
path => "/root/elasticsearch/test-logs/log-node4.log"
type => "apacher"
}
In my filter bloc, i test evry input file
I want to do somting like this :
i ={ 1,2, 3,4}
if [path] == "/root/elasticsearch/test-logs/log-node**(i)**.log" {
grok {
patterns_dir => "./patterns"
match => [ "message", "%{HTTPDATE:timestamp}|{DATA:httpsession}}" ]
}
mutate {
add_field => { "httpsessionNode(i)" => "%{httpsession}" }
}
}
Can u help me
thx
}