# Scripted Fields in kibana not working

**URL:** <https://discuss.elastic.co/t/scripted-fields-in-kibana-not-working/117661>\
**Category:** Kibana\
**Created:** [January 30, 2018, 4:30pm UTC](https://discuss.elastic.co/t/scripted-fields-in-kibana-not-working/117661 "2018-01-30T16:30:20Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)\
**Post date:** [January 31, 2018, 1:17am UTC](https://discuss.elastic.co/t/scripted-fields-in-kibana-not-working/117661/2 "2018-01-31T01:17:50Z")

</div>

It's possible to do this with the Time Series Visual Builder

I have used the following data to test against:

```auto
POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 1,
  "somme": 1
}

POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 1,
  "somme": 1
}

POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 1,
  "somme": 1
}

POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 0,
  "somme": 0
}

POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 0,
  "somme": 0
}

POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 0,
  "somme": 0
}

POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 1,
  "somme": 1
}

POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 1,
  "somme": 1
}

POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 1,
  "somme": 1
}

POST discuss-117661/doc
{
  "@timestamp": "2018-01-30T14:25:04",
  "Return_Code": 1,
  "somme": 1
}

```

Create a new visualization using the Time Series Visual Builder.

First, select the Panel Options tab and enter the index pattern you would want to use.

Then, back on the Data tab, select use the Filter Ratio Aggregation. For the numerator, we will select the successful documents using `Return_Code:1`

 ![11](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0ad79106eeb0faca52a8fa2a304d37065b544fd6.png)

---

_[View the full topic](https://discuss.elastic.co/t/scripted-fields-in-kibana-not-working/117661)._
