# Logstash text to array conversion

**URL:** https://discuss.elastic.co/t/logstash-text-to-array-conversion/261393
**Category:** Logstash
**Created:** [January 18, 2021, 8:32am UTC](https://discuss.elastic.co/t/logstash-text-to-array-conversion/261393 "2021-01-18T08:32:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![thotakura2](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thotakura2/32/56839_2.png) [@thotakura2](https://discuss.elastic.co/u/thotakura2)
#### Post date: [January 18, 2021, 8:32am UTC](https://discuss.elastic.co/t/logstash-text-to-array-conversion/261393/1 "2021-01-18T08:32:47Z")

</div>

Hi all,  
I am trying to index data from MySQL and one of the fields is delimited by `; and ,`. I want to convert it into array by delimiting it with both the characters. Currently i am using the following filter:

```auto
filter 
{ 
  mutate
   { 
      split => { "scopus_aff_ids" => ";" } 
   }
}

```

This is able to delimit only based on `;`. But in some records data is delimited with `,`.  
Please help me in achieving this

---

<div class="post-metadata">

### Author: ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)
#### Post date: [January 19, 2021, 3:30pm UTC](https://discuss.elastic.co/t/logstash-text-to-array-conversion/261393/2 "2021-01-19T15:30:38Z")

</div>

If your data supports this, maybe replace all `,` with `;` prior to your split then it should catch them all.

```auto
mutate {
  gsub => [
    "scopus_aff_ids", ",", ";",
  ]
}

```

---

<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 16, 2021, 3:30pm UTC](https://discuss.elastic.co/t/logstash-text-to-array-conversion/261393/3 "2021-02-16T15:30:39Z")

</div>

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