Using [log][file][path] in mail output for logstash

Hi guys,

I'm using Filebeat, Logstash and Elasticsearch and I'm sending mail when a certain log file has passed a condition.
Now, I would like to add the path of the log file to my mail so that the recipient knows
where to look but I don't know how to do that properly.

I am using Mustache as a mail template but for now, I have this code:

    email {
             to => 'xxx'
             from => 'xxx'
             subject => 'Critical error found in %{host}'
             body => 'Critical error found in: %{host}\nContent:\n%{[log][file][path]}'
             address => 'xxx'
             port => 1025
             use_tls => true
           }

The output however is just:

        Content:
        %{[log][file][path]}

So how do I fix this?

Thanks in advance.

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