# Can't disable logstash.codecs.json logging

**URL:** <https://discuss.elastic.co/t/cant-disable-logstash-codecs-json-logging/146199>\
**Category:** Logstash\
**Created:** [August 27, 2018, 2:51pm UTC](https://discuss.elastic.co/t/cant-disable-logstash-codecs-json-logging/146199 "2018-08-27T14:51:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [August 27, 2018, 2:51pm UTC](https://discuss.elastic.co/t/cant-disable-logstash-codecs-json-logging/146199/1 "2018-08-27T14:51:54Z")

</div>

Logstash 6.3

I am trying to disable logging from the port 9600 and seems to reject every value though I can change other loggers just not  
logstash.codecs.json

"error" : "unrecognized option [logstash.codecs.json]"

* * *

## Details below

I am using the INPUT UDP with a Codec of JSON,

```auto
input {
  udp {
    id => "udp-5514-XXXXXX"
    host => "0.0.0.0"  
    port => 5514      
    type => "microservices" # what kinds of logs are coming in
    codec => "json"
    tags => ["udp","microservice"]
            buffer_size => 10240000
            receive_buffer_bytes => 1024000
            workers => 1
  }
}

```

Unfortunately I can not use the JSON Filter because UDP will sometime merge those objects and make invalid JSON.

My problem is that Every time the codec received a non-json data it outputs an ERROR, which is filling up my file system

Unfortately it will not be easy for us to fix what is coming in.

So I tried disabling the Codec logging but it produces an error like so

```auto
[2018-08-27T10:24:54,005][ERROR][logstash.codecs.json] JSON parse error, original data now in message field {:error=>#<LogStash::Json::ParserError: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: (String)"<30>2018-08-27T14:25:09Z 6ed9dc4069ac logger/lat-prod-customernotificationservice[60806]: {"@timestamp":"2018-08-27T14:25:09.668+00:00","logger_name":"application","thread_name":"DispatchThread: [com.ibm.mq.jmqi.remote.impl.RemoteSession[connectionId=414D5143424D5320202020202020202046E64F58FD131D2A]]","level":"INFO","service":"customer-notification-service","msg":"Receiving message from queue correlationId=10.130.216.5215353799091400000000012847"}

```

```auto
[root@hd1melk20lx ~]# curl -GET 'localhost:9600/_node/logging?pretty''
{
  "host" : "hd1melk20lx.digital.hbc.com",
  "version" : "6.3.0",
  "http_address" : "127.0.0.1:9600",
  "id" : "c48718ef-373b-4120-a9a2-a89da6212aa4",
  "name" : "hd1melk20lx.digital.hbc.com",
  "loggers" : {
.....
deleted for brevity 
......
    "logstash.agent" : "INFO",
    "logstash.api.service" : "INFO",
    "logstash.codecs.json" : "INFO",
.....
deleted for brevity 
......
   }
}

```

Setting it to off or any other value fails

```auto
[root@hd1melk20lx ~]# curl -PUT 'localhost:9600/_node/logging?pretty' -H 'Content-Type: application/json' -d'
{
    "logstash.codecs.json" : "OFF"
}
'

```

Error Response

```auto
{
  "host" : "hd1melk20lx.digital.hbc.com",
  "version" : "6.3.0",
  "http_address" : "127.0.0.1:9600",
  "id" : "c48718ef-373b-4120-a9a2-a89da6212aa4",
  "name" : "hd1melk20lx.digital.hbc.com",
  "error" : "unrecognized option [logstash.codecs.json]"
}

```

---

<div class="post-metadata">

**Author:** ![eperry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/eperry/32/551_2.png) [@eperry](https://discuss.elastic.co/u/eperry)\
**Post date:** [August 27, 2018, 2:58pm UTC](https://discuss.elastic.co/t/cant-disable-logstash-codecs-json-logging/146199/2 "2018-08-27T14:58:23Z")

</div>

Never mind figured it out

````auto
[root@hd1melk20lx logstash]# curl -XPUT 'localhost:9600/_node/logging?pretty' -H 'Content-Type: application/json' -d'
{
    "logger.logstash.codecs.json" : "off"
}
'
{
  "host" : "hd1melk20lx.digital.hbc.com",
  "version" : "6.3.0",
  "http_address" : "127.0.0.1:9600",
  "id" : "c48718ef-373b-4120-a9a2-a89da6212aa4",
  "name" : "hd1melk20lx.digital.hbc.com",
  "acknowledged" : true
}```
````

---

<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:** [September 24, 2018, 3:03pm UTC](https://discuss.elastic.co/t/cant-disable-logstash-codecs-json-logging/146199/3 "2018-09-24T15:03:13Z")

</div>

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