# Logstash\_index

**URL:** <https://community.auth0.com/t/logstash-index/7444>\
**Category:** Get Help\
**Tags:** logs, integrations\
**Created:** [July 10, 2017, 9:31pm UTC](https://community.auth0.com/t/logstash-index/7444 "2017-07-10T21:31:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![charles.hepner](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/charles.hepner/32/7786_2.png) [@charles.hepner](https://community.auth0.com/u/charles.hepner)\
**Post date:** [July 10, 2017, 9:31pm UTC](https://community.auth0.com/t/logstash-index/7444/1 "2017-07-10T21:31:29Z")

</div>

The documentation for the Auth0 Logstash integration:

> **[Create Custom Log Streams Using Webhooks - Auth0 Docs](https://auth0.com/docs/customize/log-streams/custom-log-streams)**
>
> Learn how to configure a log stream using a custom webhook to stream log events to the URL of your choice.

mentions setting LOGSTASH\_INDEX. Can an example be provide in the documentation of how to set this? The docs are not clear; typically I would configure the index in the Logstash output plugin, not here in Auth0.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [July 11, 2017, 3:04pm UTC](https://community.auth0.com/t/logstash-index/7444/2 "2017-07-11T15:04:10Z")

</div>

If you only use one index then its name could just be hardcoded in the output configuration and this setting would be mostly irrelevant, however, if you want to redirect data to multiple indexes than you’ll use some field coming from the input data as a way to resolve the respective index name.

The _LOGSTASH\_INDEX_ is just a field, named `index`, that will be added to the payload sent to Logstash in every event; if you had multiple Auth0 accounts sending to the same infrastructure this could be used for disambiguation and could possibly be used directly for redirecting to the correct index. For example, in your setup configuration you could do:

```
index => "%{index}-%{+YYYY.MM.dd}"

```

---

<div class="post-metadata">

**Author:** ![charles.hepner](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/charles.hepner/32/7786_2.png) [@charles.hepner](https://community.auth0.com/u/charles.hepner)\
**Post date:** [July 12, 2017, 1:32am UTC](https://community.auth0.com/t/logstash-index/7444/3 "2017-07-12T01:32:21Z")

</div>

Thanks for the reply! I tried setting a few different various values for LOGSTASH\_INDEX in the config for the extension. What I found is that whatever value I set was sent as a field with that name, set to a value of “auth0”.

For example, initially I was confused by the documentation so I entered: LOGSTASH\_INDEX = auth0-%{+YYYY.MM.dd} in the Auth0 Extension config

In elasticsearch I then got a field named “auth0-%{+YYYY.MM.dd}” with a value of “auth0”.

I have currently settled on LOGSTASH\_INDEX = source, which gives me a field “source” set to the value “auth0”.

---

<div class="post-metadata">

**Author:** ![charles.hepner](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/charles.hepner/32/7786_2.png) [@charles.hepner](https://community.auth0.com/u/charles.hepner)\
**Post date:** [July 12, 2017, 1:32am UTC](https://community.auth0.com/t/logstash-index/7444/4 "2017-07-12T01:32:21Z")

</div>

Thanks for the reply! I tried setting a few different various values for LOGSTASH\_INDEX in the config for the extension. What I found is that whatever value I set was sent as a field with that name, set to a value of “auth0”.

For example, initially I was confused by the documentation so I entered: LOGSTASH\_INDEX = auth0-%{+YYYY.MM.dd} in the Auth0 Extension config

In elasticsearch I then got a field named “auth0-%{+YYYY.MM.dd}” with a value of “auth0”.

I have currently settled on LOGSTASH\_INDEX = source, which gives me a field “source” set to the value “auth0”.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [July 12, 2017, 3:07am UTC](https://community.auth0.com/t/logstash-index/7444/5 "2017-07-12T03:07:17Z")

</div>

Damn, I looked at the [code](https://github.com/auth0-extensions/auth0-logs-to-logstash/blob/c2d28de37ffd4e3e1b8106bd0d4a9877266fbdc6/server/lib/processLogs.js#L33) before giving you the reply, but I misinterpreted it (aka I read the code as if it was doing what made sense to me at the time instead of what it actually does).

**In conclusion** , what it’s [doing](https://goo.gl/JWFXXJ) which is what you describe does not make sense to me. I’ll need to follow-up with this internally; sorry for misleading you.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 2, 2018, 5:55am UTC](https://community.auth0.com/t/logstash-index/7444/6 "2018-03-02T05:55:15Z")

</div>


