# Index HTTP response code using HTTP API input?

**URL:** <https://community.graylog.org/t/index-http-response-code-using-http-api-input/407>\
**Category:** Graylog Central (peer support)\
**Created:** [March 9, 2017, 4:39pm UTC](https://community.graylog.org/t/index-http-response-code-using-http-api-input/407 "2017-03-09T16:39:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![strutdepot](https://avatars.discourse-cdn.com/v4/letter/s/9d8465/32.png) [@strutdepot](https://community.graylog.org/u/strutdepot)\
**Post date:** [March 9, 2017, 4:39pm UTC](https://community.graylog.org/t/index-http-response-code-using-http-api-input/407/1 "2017-03-09T16:39:03Z")

</div>

I configured a “JSON path from HTTP API input” (in Graylog 2.2.2+691b4b7) and can see the received messages. I am wondering if it is possible to index the HTTP response code and response time? I plan to subsequently use these to generate alerts (for bad or delayed responses).

Looking at extractors documentation it sounds like the message needs to contain the information I am looking for before I can use extractors on them. In this case, I do not see HTTP response code or response time even if the complete message in indexed (with “$” as “JSON path of data to extract”). Am I missing something?

---

<div class="post-metadata">

**Author:** ![derPhlipsi](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/derphlipsi/32/38_2.png) [@derPhlipsi](https://community.graylog.org/u/derPhlipsi)\
**Post date:** [March 9, 2017, 5:00pm UTC](https://community.graylog.org/t/index-http-response-code-using-http-api-input/407/2 "2017-03-09T17:00:49Z")

</div>

Hey @strutdepot,

the response code / time is not part of the JSON-Path. The Input only uses the HTTP Response Content, checks it for a valid JSON-String and then tries to extract the value from the given JSON-Path.  
If you want to get the response code / time, your server would have to write it into the JSON-String, or you would have to write your own plugin. [There is a plugin](https://github.com/sivasamyk/graylog2-plugin-input-httpmonitor) that is able to get the response code and time and also is able to get the HTTP Response Content, which you can use the JSON-Extractor on.

Greetings - Phil
