# Winlogbeat to write output to a file

**URL:** https://discuss.elastic.co/t/winlogbeat-to-write-output-to-a-file/234525
**Category:** Beats
**Tags:** winlogbeat
**Created:** [May 27, 2020, 10:42am UTC](https://discuss.elastic.co/t/winlogbeat-to-write-output-to-a-file/234525 "2020-05-27T10:42:05Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![guruprasadh4](https://avatars.discourse-cdn.com/v4/letter/g/cab0a1/32.png) [@guruprasadh4](https://discuss.elastic.co/u/guruprasadh4)
#### Post date: [May 27, 2020, 10:42am UTC](https://discuss.elastic.co/t/winlogbeat-to-write-output-to-a-file/234525/1 "2020-05-27T10:42:06Z")

</div>

Team,

Is there a way we can have filename dynamically picks the host.name while writing to a file ?

Something like below.

```auto
output.file:
  path: "/tmp/winlogbeat"
  filename: ***${host.name}***

```

---

<div class="post-metadata">

### Author: ![Andre\_Letterer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_letterer/32/42248_2.png) [@Andre\_Letterer](https://discuss.elastic.co/u/Andre_Letterer)
#### Post date: [May 28, 2020, 11:01pm UTC](https://discuss.elastic.co/t/winlogbeat-to-write-output-to-a-file/234525/2 "2020-05-28T23:01:18Z")

</div>

Hi Prasad,

What you are trying to do is more a mix of linux world and try to replace beat fields with variables try.  
But we talk about winlogbeat under windows.  
So a path /tmp doesn't exist under windows and I think the variable you are looking for is `COMPUTERNAME`.  
[https://www.elastic.co/guide/en/beats/filebeat/current/using-environ-vars.html](https://www.elastic.co/guide/en/beats/filebeat/current/using-environ-vars.html)  
So I assume you are trying to do something like this:

```auto
output.file:
  path: "${TEMP}/winlogbeat"
  filename: "${COMPUTERNAME}"

```

if you want to setup direct paths, then you will replace your path variable with something like that:

```auto
output.file:
  path: "c:/winlogbeat"
  filename: "${COMPUTERNAME}"

```

---

<div class="post-metadata">

### Author: ![guruprasadh4](https://avatars.discourse-cdn.com/v4/letter/g/cab0a1/32.png) [@guruprasadh4](https://discuss.elastic.co/u/guruprasadh4)
#### Post date: [June 2, 2020, 4:54pm UTC](https://discuss.elastic.co/t/winlogbeat-to-write-output-to-a-file/234525/3 "2020-06-02T16:54:36Z")

</div>

Hello Andre,  
Thanks!

---

<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: [June 30, 2020, 6:54pm UTC](https://discuss.elastic.co/t/winlogbeat-to-write-output-to-a-file/234525/4 "2020-06-30T18:54:37Z")

</div>

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