# Adding Scripted field through Kibana , apping fails in ElasticSearch

**URL:** https://discuss.elastic.co/t/adding-scripted-field-through-kibana-apping-fails-in-elasticsearch/81003
**Category:** Kibana
**Created:** [April 3, 2017, 12:56pm UTC](https://discuss.elastic.co/t/adding-scripted-field-through-kibana-apping-fails-in-elasticsearch/81003 "2017-04-03T12:56:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![balraj.sandhu098](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@balraj.sandhu098](https://discuss.elastic.co/u/balraj.sandhu098)
#### Post date: [April 3, 2017, 12:56pm UTC](https://discuss.elastic.co/t/adding-scripted-field-through-kibana-apping-fails-in-elasticsearch/81003/1 "2017-04-03T12:56:14Z")

</div>

Hi,

I am trying to create pie chart for Apache logs, I have passed logs through logstash and could see server\_response field which I created to see the response status for visited sites. I am not able to find server\_response field under visualization while using the histogram to prepare 200 response code graph.

Can you please let me know how I can see server\_response field under visualization, I can add the same field while running search on discover.

I tried creating scripting field from Kibana as doc[server.response].value. It starts reflected under visualization but I am getting error in elastic search.

No field found for [server\_response] in mapping with types

---

<div class="post-metadata">

### Author: ![spalger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spalger/32/14092_2.png) [@spalger](https://discuss.elastic.co/u/spalger)
#### Post date: [April 3, 2017, 8:00pm UTC](https://discuss.elastic.co/t/adding-scripted-field-through-kibana-apping-fails-in-elasticsearch/81003/2 "2017-04-03T20:00:48Z")

</div>

You probably want to use a terms agg for that field.

Either way, can you share the mapping for the `server_response` field? Is elasticsearch storing it as a number?

---

<div class="post-metadata">

### Author: ![balraj.sandhu098](https://avatars.discourse-cdn.com/v4/letter/b/9de053/32.png) [@balraj.sandhu098](https://discuss.elastic.co/u/balraj.sandhu098)
#### Post date: [April 4, 2017, 8:13am UTC](https://discuss.elastic.co/t/adding-scripted-field-through-kibana-apping-fails-in-elasticsearch/81003/3 "2017-04-04T08:13:54Z")

</div>

Thanks Spencer. I was able to fix the issue. I needed to refresh my index fields to populate the required fields.

---

<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: [May 2, 2017, 8:13am UTC](https://discuss.elastic.co/t/adding-scripted-field-through-kibana-apping-fails-in-elasticsearch/81003/4 "2017-05-02T08:13:55Z")

</div>

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