Hi
on my web server I have following configuration for access log
location : /var/log/customerA/access.log
location : /var/log/customerB/access.log
location : /var/log/customerC/access.log
So i think i need only one log stash agent(install) and config file like following ?
input {
file{
path =>"/var/log/customerA/.log"
start_position => "beginning"
}
file{
path =>"/var/log/customerB/.log"
start_position => "beginning"
}
file{
path =>"/var/log/customerC/.log"
start_position => "beginning"
}
}
filter{
if [path]== "/var/log/customerA/.log"
{
my grok patterns
}
else if [path] == "/var/log/customerB/*.log"
{
my grok patterns
}
else if [path] == "/var/log/customerC/*.log"
{
my grok patterns
}
output {
if [path] == "/var/log/customerA/.log"
{
elasticsearch {
hosts => "http://localhost:9200"
index => "customerA_index"
}
}
else if [path] == "/var/log/customerB/.log"
{
elasticsearch{
hosts => "http://localhost:9200"
index => "customerB_index"
}
}
else if [path] == "/var/log/customerB/*.log"
{
elasticsearch{
hosts => "http://localhost:9200"
index => "customerC_index"
}
}
stdout {
codec => dots {}
}
}