HI,
I am trying to parse a parent log file and try to store the logs into separate output files based on keyword.
Sample code i have used for creating a logstash.conf file can be found below
input {
file {
path => ["Path to input file "]
type => "log"
start_position => "beginning"
}
}
filter {
grok {
match => { "message" => "%{TIME:timestamp}%{SPACE}%{LOGLEVEL:level}%{SPACE}[(?[^]]+)]%{SPACE}((?[^)]+))%{SPACE}%{WORD:tenant}%{SPACE}%{DATA:message}" }
}
}
output {
if "KeyWord" in [variable_name]{
file {
path => ["/%{variable_name}.log"]
}
}
}
The above code creates output files per based on the key word that is present in the input files.
I am looking to rotate the out files generated by this logstatsh.conf files.
Request you to help me on this.