# Index name with http input and es\_bulk codec

**URL:** <https://discuss.elastic.co/t/index-name-with-http-input-and-es-bulk-codec/152650>\
**Category:** Logstash\
**Created:** [October 16, 2018, 12:10pm UTC](https://discuss.elastic.co/t/index-name-with-http-input-and-es-bulk-codec/152650 "2018-10-16T12:10:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![redX](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/redx/32/21864_2.png) [@redX](https://discuss.elastic.co/u/redX)\
**Post date:** [October 16, 2018, 12:10pm UTC](https://discuss.elastic.co/t/index-name-with-http-input-and-es-bulk-codec/152650/1 "2018-10-16T12:10:40Z")

</div>

**TL;DR:**  
I get bulk inserts, but the index name is not in the output of logstash. How do I get the index name from the input request?

**Long version:**  
I have multiple single index request in bulk form. e.g.:

```
PUT /_bulk HTTP/1.1
Content-Type: application/json; charset=utf-8
Content-Length: 97
Host: hostname:5555
Connection: Keep-Alive
Accept-Encoding: gzip
User-Agent: okhttp/3.3.1

{"index": { "_index": "test-index-name", "_type": "doc"}}
{ "test":"9b10d1be-8409-4b96-8939-27d3a714e807" }

```

I want to enhance these requests with logstash. For debug purposes, I have a very simple conf:

```
input {
  http {
    port => 5555
    codec => es_bulk
  }
}
output {
  stdout {
    codec => rubydebug
  }
}

```

This is the output in the console:

```
{
  "host" => "10.201.18.178",
  "@version" => "1",
  "headers" => {
    "request_uri" => "/_bulk",
    "http_accept_encoding" => "gzip",
    "content_type" => "application/json; charset=utf-8",
    "request_path" => "/_bulk",
    "http_user_agent" => "okhttp/3.3.1",
    "http_connection" => "Keep-Alive",
    "content_length" => "97",
    "request_method" => "PUT",
    "http_version" => "HTTP/1.1",
    "http_host" => "hostname:5555"
  },
  "@timestamp" => 2018-10-16T12:08:12.848Z,
  "test" => "9b10d1be-8409-4b96-8939-27d3a714e807"
}

```

In the result from logstash, the index name `test-index-name` is missing.  
How do I get that index name, so I can forward the index request to elasticsearch?

Logstash version 6.3.0

Kind regards,  
redX

---

<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:** [November 13, 2018, 12:25pm UTC](https://discuss.elastic.co/t/index-name-with-http-input-and-es-bulk-codec/152650/2 "2018-11-13T12:25:13Z")

</div>

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