# Strip part of message Logstash

**URL:** <https://discuss.elastic.co/t/strip-part-of-message-logstash/204232>\
**Category:** Logstash\
**Created:** [October 18, 2019, 1:11pm UTC](https://discuss.elastic.co/t/strip-part-of-message-logstash/204232 "2019-10-18T13:11:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Senthil\_ak](https://avatars.discourse-cdn.com/v4/letter/s/eb9ed0/32.png) [@Senthil\_ak](https://discuss.elastic.co/u/Senthil_ak)\
**Post date:** [October 18, 2019, 1:12pm UTC](https://discuss.elastic.co/t/strip-part-of-message-logstash/204232/1 "2019-10-18T13:12:00Z")

</div>

Hi,  
I am trying to strip part of message, with below configuration but getting mutate error, could you please check what I am doing wrong.

Message  
`[<XXX.XX.XX.XX>:<XXXX> <YYYY.YY.YY.YY>:<YYYY>,<XXX.XX.XX.XX>:<XXXX> <YYYY.YY.YY.YY>:<YYYY>]`

since the same IP's are logging two times i am stripping the second part after ','

```
  mutate { 
    replace => { "type" => "sm_access" } 
    split => ["AuthDirserver", ","]
    add_field => { "AuthDirServer_1" => "%{AuthDirserver[0]}" }
  }
  mutate { 
    rename => ["AuthDirServer_1", "AuthDirServer"]
  }

```

Error Message

```
   "AuthDirserver" => [
    [0] "<XXX.XX.XX.XX>:<XXXX> <YYYY.YY.YY.YY>:<YYYY>",
    [1] "<XXX.XX.XX.XX>:<XXXX> <YYYY.YY.YY.YY>:<YYYY>"
],
            "tags" => [
    [0] "_mutate_error"
],
```

---

<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:** [November 15, 2019, 1:12pm UTC](https://discuss.elastic.co/t/strip-part-of-message-logstash/204232/2 "2019-11-15T13:12:11Z")

</div>

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