# Extract a field from a text field

**URL:** <https://discuss.elastic.co/t/extract-a-field-from-a-text-field/305756>\
**Category:** Elasticsearch\
**Created:** [May 26, 2022, 9:38pm UTC](https://discuss.elastic.co/t/extract-a-field-from-a-text-field/305756 "2022-05-26T21:38:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RaonyO](https://avatars.discourse-cdn.com/v4/letter/r/5fc32e/32.png) [@RaonyO](https://discuss.elastic.co/u/RaonyO)\
**Post date:** [May 26, 2022, 9:38pm UTC](https://discuss.elastic.co/t/extract-a-field-from-a-text-field/305756/1 "2022-05-26T21:38:29Z")

</div>

I'm trying to extract the fields that come within the "indicator" and "agentDetectionInfo" field, could someone help me?  
here's the log in json:

```auto
{
  "_index": "xxx",
  "_type": "_doc",
  "_id": "xxxxxhvfUu_M2V8K",
  "_score": 1,
  "fields": {
    "indicators": [
      "[{'category': 'Abnormalities', 'description': 'This binary contains abnormal section names which could be an indication that it was created with non-standard development tools', 'ids': [1], 'tactics': []}, {'category': 'Hiding/Stealthiness', 'description': 'The majority of sections in this PE have high entropy, a sign of obfuscation or packing', 'ids': [29], 'tactics': []}]"
    ],
    "@timestamp": [
      "2022-05-18T12:23:45.251Z"
    ],
    "agentDetectionInfo": [
      "{'accountId': 'xxxx36xx4xxx4xx3', 'accountName': 'XXX Software', 'agentDetectionState': 'full_mode'}"
    ],
}

```

---

<div class="post-metadata">

**Author:** ![Tomo\_M](https://avatars.discourse-cdn.com/v4/letter/t/848f3c/32.png) [@Tomo\_M](https://discuss.elastic.co/u/Tomo_M)\
**Post date:** [May 27, 2022, 3:33am UTC](https://discuss.elastic.co/t/extract-a-field-from-a-text-field/305756/2 "2022-05-27T03:33:39Z")

</div>

Hi,

You may need [JSON processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/json-processor.html) of ingest pipeline to parse the string while indexing, or using Logstash or some ETL client to parse the string before indexing the documents.

---

<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:** [June 24, 2022, 3:34am UTC](https://discuss.elastic.co/t/extract-a-field-from-a-text-field/305756/3 "2022-06-24T03:34:13Z")

</div>

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