# Problem with parse json in strings

**URL:** <https://discuss.elastic.co/t/problem-with-parse-json-in-strings/240435>\
**Category:** Logstash\
**Created:** [July 8, 2020, 10:38pm UTC](https://discuss.elastic.co/t/problem-with-parse-json-in-strings/240435 "2020-07-08T22:38:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vladimir\_Martyshin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vladimir_martyshin/32/57042_2.png) [@Vladimir\_Martyshin](https://discuss.elastic.co/u/Vladimir_Martyshin)\
**Post date:** [July 8, 2020, 10:38pm UTC](https://discuss.elastic.co/t/problem-with-parse-json-in-strings/240435/1 "2020-07-08T22:38:18Z")

</div>

Hello!  
I am trying to parse logs. The log have field "message".  
When I have message: `Connection lost after 18 seconds` all ok.

But, when I get the log with message: `CMD: exit`. I get the following error in logstash:

```auto
object mapping for [input] tried to parse field [input] as object, but found a concrete value

```

How can I say to logstash ignore all special symbols, like ":" and recognize it as simple string?  
I tried this ` " convert => { "[message]" => "string"` but it didn't help. Any help someone?

---

<div class="post-metadata">

**Author:** ![fadjar340](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/fadjar340/32/43610_2.png) [@fadjar340](https://discuss.elastic.co/u/fadjar340)\
**Post date:** [July 9, 2020, 3:51pm UTC](https://discuss.elastic.co/t/problem-with-parse-json-in-strings/240435/2 "2020-07-09T15:51:29Z")

</div>

Try this to change the CMD:

```auto
filter {
  mutate {
	gsub => [
          "message", "CMD:", "CMD -"
       ]
  }
.
.
.
.
}

```

---

<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:** [August 6, 2020, 3:51pm UTC](https://discuss.elastic.co/t/problem-with-parse-json-in-strings/240435/3 "2020-08-06T15:51:33Z")

</div>

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