# Scripted fields from Message

**URL:** https://discuss.elastic.co/t/scripted-fields-from-message/168002
**Category:** Elasticsearch
**Created:** [February 12, 2019, 9:44am UTC](https://discuss.elastic.co/t/scripted-fields-from-message/168002 "2019-02-12T09:44:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![priya08](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@priya08](https://discuss.elastic.co/u/priya08)
#### Post date: [February 12, 2019, 9:44am UTC](https://discuss.elastic.co/t/scripted-fields-from-message/168002/1 "2019-02-12T09:44:37Z")

</div>

Hi ,

How can we created the scripted field(datetime) from "message" field. Please find the sample input

{  
"\_index": "abcd",  
"\_type": "doc",  
"\_id": "abcd",  
"\_version": 1,  
"\_score": null,  
"\_source": {  
"@version": "1",  
"@timestamp": "2019-02-12T06:55:09.182Z",  
"message": "[INFO] SYSLOG-\>|datetime:20190212154454+0530|hostname:abcd|threadId:abcd(main)|userId:null"  
}

---

<div class="post-metadata">

### Author: ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)
#### Post date: [February 12, 2019, 9:45am UTC](https://discuss.elastic.co/t/scripted-fields-from-message/168002/2 "2019-02-12T09:45:55Z")

</div>

You should really parse this out before you index it into Elasticsearch, e.g. using Logstash or an ingest node pipeline, as that will perform and scale much better.

---

<div class="post-metadata">

### Author: ![priya08](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@priya08](https://discuss.elastic.co/u/priya08)
#### Post date: [February 12, 2019, 9:51am UTC](https://discuss.elastic.co/t/scripted-fields-from-message/168002/3 "2019-02-12T09:51:36Z")

</div>

I am using logstash file , but in that file we are having so many grok patterns (In our application we are having so many log statements , for each statement we are having one pattern) . Can we achieve this using scripted fields . Because if any new fields adding in logger level , we need to change the grok pattern , that is bit challenge for us , because we are having so many patterns.

---

<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: [March 12, 2019, 9:51am UTC](https://discuss.elastic.co/t/scripted-fields-from-message/168002/4 "2019-03-12T09:51:41Z")

</div>

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