Creating multiple output files in Logstash

Hello,

I have my input section where I have a given path which has multiple directories and log files in it. I have written the following:

input {
file {
path => "/home/deepthi/Desktop/logs/**/*.log"
}
}

I want to create multiple output files in the output section with the same name as the input file name and just append '-logoutput.log' at the end of the filename. Can anybody please tell me how this can be achieved in Logstash?

Thanks in advance!

Deepthi

The path to the input file is added to the path field. You can reference that field in your file output configuration:

path => "%{path}-logoutput.log"

https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references

I got this working! Thank you very much Magnus

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.