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

**URL:** <https://discuss.elastic.co/t/using-log-file-path-in-mail-output-for-logstash/200692>\
**Category:** Logstash\
**Created:** [September 23, 2019, 12:37pm UTC](https://discuss.elastic.co/t/using-log-file-path-in-mail-output-for-logstash/200692 "2019-09-23T12:37:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndriesN](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andriesn/32/54380_2.png) [@AndriesN](https://discuss.elastic.co/u/AndriesN)\
**Post date:** [September 23, 2019, 12:37pm UTC](https://discuss.elastic.co/t/using-log-file-path-in-mail-output-for-logstash/200692/1 "2019-09-23T12:37:16Z")

</div>

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:

```auto
    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:

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

```

So how do I fix this?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 21, 2019, 12:47pm UTC](https://discuss.elastic.co/t/using-log-file-path-in-mail-output-for-logstash/200692/2 "2019-10-21T12:47:31Z")

</div>

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