# How to separate Winlogbeat logs to different ES indexes

**URL:** <https://discuss.elastic.co/t/how-to-separate-winlogbeat-logs-to-different-es-indexes/71529>\
**Category:** Beats\
**Tags:** winlogbeat\
**Created:** [January 13, 2017, 2:20pm UTC](https://discuss.elastic.co/t/how-to-separate-winlogbeat-logs-to-different-es-indexes/71529 "2017-01-13T14:20:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufomen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ufomen/32/14554_2.png) [@ufomen](https://discuss.elastic.co/u/ufomen)\
**Post date:** [January 13, 2017, 2:20pm UTC](https://discuss.elastic.co/t/how-to-separate-winlogbeat-logs-to-different-es-indexes/71529/1 "2017-01-13T14:20:24Z")

</div>

Hello all! And sorry for my english...

I have tons of security logs on my elasticsearch. Now I wanna store Windows security logs for 2 weeks, and other (app, system) logs for 3-6 month. So, I think easiest way to do that have 2 types of winlogbeat indices:

- winlogbeatSEC-2017.01.11 for security logs ,
- winlogbeat-2017.01.11 for other Windows logs.

So I can simply and quickly delete winlogbeatSEC indices by the script.

How can I divide win logs by "log\_name"?

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 13, 2017, 2:28pm UTC](https://discuss.elastic.co/t/how-to-separate-winlogbeat-logs-to-different-es-indexes/71529/2 "2017-01-13T14:28:08Z")

</div>

> <https://stackoverflow.com/questions/27146032/make-logstash-add-different-inputs-to-different-indices>

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [January 13, 2017, 8:59pm UTC](https://discuss.elastic.co/t/how-to-separate-winlogbeat-logs-to-different-es-indexes/71529/3 "2017-01-13T20:59:00Z")

</div>

If you are going direct to Elasticsearch you could use the `indices` config option to control the destination index. See [https://www.elastic.co/guide/en/beats/winlogbeat/current/elasticsearch-output.html#\_indices](https://www.elastic.co/guide/en/beats/winlogbeat/current/elasticsearch-output.html#_indices)

```auto
output.elasticsearch:
  hosts: ["http://localhost:9200"]
  index: "winlogbeat-%{+yyyy.MM.dd}"
  indices:
    - index: "winlogbeat-security-%{+yyyy.MM.dd}"
      when.equals:
        log_name: "Security"

```

I recommend using "winlogbeat-security" over "winlogbeatSEC" because the provided index template and sample dashboards will continue to work because they are all based on a pattern matching `winlogbeat-*`.

---

<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:** [February 10, 2017, 8:59pm UTC](https://discuss.elastic.co/t/how-to-separate-winlogbeat-logs-to-different-es-indexes/71529/4 "2017-02-10T20:59:11Z")

</div>

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