Logstash file output to different host

380 Views Asked by At

Logstash is running on a K8 pod. I'm trying to save logstash data to a file in a different host.

Can you please let me know how to set host name?

output {

    file {
        path => "/app/log/path/%{Name}-%{+YYYY-MM-dd}.log"
    }
}
1

There are 1 best solutions below

0
On

You can't, the file output only writes locally, there is no option to set a host.

To use the file output to write in another host you would need to export the directory from the target host and mount it in the logstash machine.