# How to turn fields in a text file into terms in kibana

**URL:** <https://discuss.elastic.co/t/how-to-turn-fields-in-a-text-file-into-terms-in-kibana/107551>\
**Category:** Logstash\
**Created:** [November 14, 2017, 1:18pm UTC](https://discuss.elastic.co/t/how-to-turn-fields-in-a-text-file-into-terms-in-kibana/107551 "2017-11-14T13:18:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yishain11](https://avatars.discourse-cdn.com/v4/letter/y/df705f/32.png) [@yishain11](https://discuss.elastic.co/u/yishain11)\
**Post date:** [November 14, 2017, 1:18pm UTC](https://discuss.elastic.co/t/how-to-turn-fields-in-a-text-file-into-terms-in-kibana/107551/1 "2017-11-14T13:18:38Z")

</div>

I have a text file, formmated like JSON:

```
"changedFieldsList": [
{
  "fieldId": "ORDER_ID",
  "fieldType": "NUMBER",
  "fieldValue": "55841",
  "fieldChanged": "Y"
},
{
  "fieldId": "ORDER_DATE",
  "fieldType": "DATE",
  "fieldValue": "2017-11-13",
  "fieldChanged": "Y"
}...
]

```

Currently, kibana (after receiving the file like so: folders -\> filebeat -\> logstash -\> elasticsearch -\> kibana) takes the entire text file as one, and I cant aggregate the file by its fields, like sort by fieldID or by value.  
How can I make logstash/kibana to process the data so that the keys in the JSON file are terms kibana can sort by?  
How can I make the elastic stack deal with the JSON format (and again - this is not a .json file, its a text file) better?  
I tried to use JSON filters in logstash, but couldn't make it, so far.  
P.S: There is another thing I'm trying to do: when I discover the data in kibana, kibana shows the file path under "source". Can I get out a portion of the path and save it as a searchable term? for example:  
/path/to/the/folder/FOLDERNAME/subdir/file  
I want to save FOLDERNAME as a variable I can aggregate the data by.  
Can anyone help?  
Yishai

---

<div class="post-metadata">

**Author:** ![yishain11](https://avatars.discourse-cdn.com/v4/letter/y/df705f/32.png) [@yishain11](https://discuss.elastic.co/u/yishain11)\
**Post date:** [November 23, 2017, 3:16pm UTC](https://discuss.elastic.co/t/how-to-turn-fields-in-a-text-file-into-terms-in-kibana/107551/2 "2017-11-23T15:16:32Z")

</div>

anyone?

---

<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:** [December 21, 2017, 3:16pm UTC](https://discuss.elastic.co/t/how-to-turn-fields-in-a-text-file-into-terms-in-kibana/107551/3 "2017-12-21T15:16:36Z")

</div>

Closed on December 21, 2017, 3:16pm UTC

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