Skip to content

json_lines codec is still not working with file input plugin #40

@shashank-gupta017

Description

@shashank-gupta017

The json_lines codec when used on the file input plugin causes the file input plugin to not process any data.

input {
  file {
    path => ["/usr/local/Cellar/logstash/7.3.0/bin/grant.log"]
    exclude => ["*.gz"]
    sincedb_path => "/usr/local/Cellar/logstash/7.3.0/bin/grant.sincedb"
    start_position => "beginning"
    codec => "json_lines"
  }
}

output {
  stdout {
      codec => rubydebug
    }
}

When I replace the codec json_lines with json, the codec works and I get the parsed json. But with json_lines, no data is printed on stdout. I read the forums that json_lines should work with file input now, but in this case, it is still giving issues.

I also verified that in the input file, each json is de-limited with a \n by running the command cat input.log|od -tx1c

The sample input looks like this

{"group_id":153,"reason_id":357,"insert_time":"2020-03-04 13:58:48.000","fix_flag":0,"std_change":100,"type":"standard","transaction_id":"01538b8d-c580-3974-b41e-b2b0fb3fc856","timestamp":"2020-03-04 13:58:48.000","refkey":"keya1","transaction_status":"NEW","easy_id":12346738,"subkey":"subkeya1","points":100}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions