# Custom field for visualization

**URL:** <https://discuss.elastic.co/t/custom-field-for-visualization/213419>\
**Category:** Kibana\
**Created:** [December 31, 2019, 8:21am UTC](https://discuss.elastic.co/t/custom-field-for-visualization/213419 "2019-12-31T08:21:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aadarsh\_Mahala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aadarsh_mahala/32/60134_2.png) [@Aadarsh\_Mahala](https://discuss.elastic.co/u/Aadarsh_Mahala)\
**Post date:** [December 31, 2019, 8:21am UTC](https://discuss.elastic.co/t/custom-field-for-visualization/213419/1 "2019-12-31T08:21:38Z")

</div>

Is it possible to create the visualization in the kibana using the custom field like eventcount value from json data?

\<{ "eventcount" : 302932229, "file" : "confidential" }/\>

---

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [December 31, 2019, 4:55pm UTC](https://discuss.elastic.co/t/custom-field-for-visualization/213419/2 "2019-12-31T16:55:22Z")

</div>

Hi there,

You can create visualizations based on any of your document's `_source` fields, or [custom scripted fields](https://www.elastic.co/guide/en/kibana/current/scripted-fields.html). As long as you've [defined your Index Patterns](https://www.elastic.co/guide/en/kibana/current/index-patterns.html), the fields should be available to your visualizations.

Note that if you've recently added new fields to your mappings, you'll need to click the "refresh Index Patterns" button to make sure they are picked up.

---

<div class="post-metadata">

**Author:** ![Aadarsh\_Mahala](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aadarsh_mahala/32/60134_2.png) [@Aadarsh\_Mahala](https://discuss.elastic.co/u/Aadarsh_Mahala)\
**Post date:** [January 2, 2020, 5:30am UTC](https://discuss.elastic.co/t/custom-field-for-visualization/213419/3 "2020-01-02T05:30:58Z")

</div>

Hello Luke,

Thanks for the swift response but my question is can we create the visualization based on the "eventcount" (data in JSON) field in metrics but not by count field default provided by kibana ?

---

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [January 11, 2020, 11:05pm UTC](https://discuss.elastic.co/t/custom-field-for-visualization/213419/4 "2020-01-11T23:05:59Z")

</div>

So just to make sure I understand, the `eventcount` field you want to create a visualization on is an integer that lives in each document? Would a `sum` aggregation do what you are looking for?

---

<div class="post-metadata">

**Author:** ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)\
**Post date:** [January 11, 2020, 11:06pm UTC](https://discuss.elastic.co/t/custom-field-for-visualization/213419/5 "2020-01-11T23:06:33Z")

</div>

If you are able to post some sample JSON for a document, it might help me to better understand your question.

---

<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:** [February 8, 2020, 11:06pm UTC](https://discuss.elastic.co/t/custom-field-for-visualization/213419/6 "2020-02-08T23:06:33Z")

</div>

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