# Best option to parse some data GROK or reindex?

**URL:** <https://discuss.elastic.co/t/best-option-to-parse-some-data-grok-or-reindex/258663>\
**Category:** Logstash\
**Created:** [December 15, 2020, 2:08am UTC](https://discuss.elastic.co/t/best-option-to-parse-some-data-grok-or-reindex/258663 "2020-12-15T02:08:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fastxl](https://avatars.discourse-cdn.com/v4/letter/f/85e7bf/32.png) [@fastxl](https://discuss.elastic.co/u/fastxl)\
**Post date:** [December 15, 2020, 2:08am UTC](https://discuss.elastic.co/t/best-option-to-parse-some-data-grok-or-reindex/258663/1 "2020-12-15T02:08:30Z")

</div>

I am collecting machine tool data and the logs I am getting are in the JSON format that can be sent to logstash. However I need to break down one of the JSON lines into some more documents. Should I try to run this through GROK filter or manipulate in Elasticsearch via reindexing/mapping?

This is what I am sending to logstash now  
`{"timestamp": "2020-11-17T19:02:19.352Z","sequence": 2460137,"deviceName": "OKUMA.MachiningCenterMA650-EAST","deviceUUID": "OKUMA.MachiningCenterMA650-EAST.190056","componentId": "Mp1","dataItemId": "Mp1ProgramHeader","Events": { "ProgramHeader": { "name": "p1ProgramHeader", "@@data": "(CIMATRON E13)( FILE NAME:24625_DET11B_BSH)( OKUMA PROGRAM )( rob.mank )( Monday November 9, 2020 - 1:22:43 PM )(slab top)( TOOL NAME: 2.0 INGER .06R 4.0 )( TOOL DIAMETER......: 2. )" } } }`

What I need to break down is  
`{ "name": "p1ProgramHeader", "@@data": "(CIMATRON E13)( FILE NAME:24625_DET11B_BSH)( OKUMA PROGRAM )( rob.mank )( Monday November 9, 2020 - 1:22:43 PM )(slab top)( TOOL NAME: 2.0 INGER .06R 4.0 )( TOOL DIAMETER......: 2. )" }`

Each item in () I need sent to a new document. These items in () are info at the beginning of a machine tool program (G code) that contain information about the job running in the machine tool.

---

<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:** [January 12, 2021, 2:08am UTC](https://discuss.elastic.co/t/best-option-to-parse-some-data-grok-or-reindex/258663/2 "2021-01-12T02:08:52Z")

</div>

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