Filebeat 6.2.4 not processing JSON log and not submitting to Logstsash

Hi,

I am trying to process a simple JSON file into Logstash but i see the logstash which is listening at port 5045 is not receiving any data from filebeat.

Here is my filebeat and logstash config

#=========================== Filebeat prospectors =============================

filebeat.prospectors:

  • type: log
    enabled: true
    paths:
    - D:\ELK\post-data*.json
    document_type: json
    json.keys_under_root: true
    json.add_error_key: true
    processors:
    • decode_json_fields:
      fields: ['message']
      target: json

#----------------------------- Logstash output --------------------------------
output.logstash:
hosts: ["localhost:5045"]

And here is my simple 1 line json from file
{"logs":[{"type":"stats","cat":"EXP","majorver":1,"minorver":3049,"assets":[{"id":"5236182236200021"},{"id":"4236182236100021"},{"id":"1234567002100021"},{"id":"3236182234500021"},{"id":"8236182234900022"},{"id":"4236182234600022"}]}],"createdDateTime":"2018-05-04T11:26:55.015Z","nat":"AG","Card":"1043712373","version":"1.0","Serial":"642","Id":"2","hd":"31","mware":"EA2"}

Can you run filebeat with in debug mode ( -e -d *) and post the resulting logs in here? (Wrap the logs between ``` ... ``` so they are more readable)

@adrisr, thanks for your response. i have managed to figure out the problem.
The file does not include a new line at the end of the file."\n"

I just added the new line"\n", data was processed and sent.

FR:Filebeat not sending JSON to file

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