# Trouble with json codec and/or date filter

**URL:** <https://discuss.elastic.co/t/trouble-with-json-codec-and-or-date-filter/106770>\
**Category:** Logstash\
**Created:** [November 7, 2017, 11:36pm UTC](https://discuss.elastic.co/t/trouble-with-json-codec-and-or-date-filter/106770 "2017-11-07T23:36:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcouto](https://avatars.discourse-cdn.com/v4/letter/t/9d8465/32.png) [@tcouto](https://discuss.elastic.co/u/tcouto)\
**Post date:** [November 7, 2017, 11:36pm UTC](https://discuss.elastic.co/t/trouble-with-json-codec-and-or-date-filter/106770/1 "2017-11-07T23:36:28Z")

</div>

Hi, I'm using ELK for centralized logging and I'm having trouble with a log. I just changed this log from plain text to json format. After I added the JSON codec, I can no longer see logs in kibana.

In the logstash debug logs I can see the logs reaching the input, filters, and output. I'm reformatting for clarity. Other logs from this box are making it to elasticsearch. I can't check the elasticsearch logs because I using the elastic cloud. I'm not sure where else to look.

```auto
input {
  file {
    type => "TomcatAccess"
    path => "/data02/logs/localhost_access_log.*"
    codec => json
  }
}
filter {
  if [type] == "TomcatAccess" {
    date {
      match => ["timestamp", "[dd/MMM/yyyy:HH:mm:ss ZZ]"]
      target => "@timestamp"
    }
  }
}
output {
    elasticsearch {
      hosts => "https://example.found.io:9243"
      user => "user"
      password => "password"
      index => "logs-%{+YYYY.MM.dd}"
    }
  }
}

```

```auto
{
  :timestamp=>"2017-11-07T15:21:49.152000-0800", 
  :message=>"Received line", 
  :path=>"/data02/logs/localhost_access_log.2017-11-07.txt", 
  :text=>"{\"host\": \"10.50.12.150\", \"x-forwarded-for\": \"-\", \"timestamp\": \"[07/Nov/2017:15:21:39 -0800]\", \"method\": \"GET\", \"path\": \"/App/testInitialized.cfm\", \"process_time_ms\": \"49\", \"status\": \"200\", \"bytes_sent\": \"1218\", \"referer\": \"-\"}", 
  :level=>:debug, 
  :file=>"logstash/inputs/file.rb", 
  :line=>"306", 
  :method=>"log_line_received"
}

```

```auto
{
  :timestamp=>"2017-11-07T15:21:49.159000-0800", 
  :message=>"output received", 
  :event=>{
    "host"=>"10.50.19.163", 
    "x-forwarded-for"=>"-", 
    "timestamp"=>"[07/Nov/2017:15:21:39 -0800]", 
    "method"=>"GET", 
    "path"=>"/App/testInitialized.cfm", 
    "process_time_ms"=>"52", 
    "status"=>"200", 
    "bytes_sent"=>"1218", 
    "referer"=>"-", 
    "@version"=>"1", 
    "@timestamp"=>"2017-11-07T23:21:39.000Z", 
    "type"=>"TomcatAccess", 
    "role"=>"app", 
    "pod"=>"pod2", 
    "environment"=>"dev", 
    "location"=>"oh"}, 
  :level=>:debug, 
  :file=>"(eval)", 
  :line=>"469", 
  :method=>"output_func"
}

```

---

<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:** [December 5, 2017, 11:36pm UTC](https://discuss.elastic.co/t/trouble-with-json-codec-and-or-date-filter/106770/2 "2017-12-05T23:36:38Z")

</div>

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