I'm trying to send a single line JSON input file to Filebeat which should read and send in the data over to Logstash which should then forward or dump it to Azure Data Explorer cluster-table.
Somehow, when the Filebeat service is set to run and .json file is put in the input directory, nothing happens and no output is seen in the logstash VM as well. Also, no data gets dumped to the ADX table.
Any help would be greatly appreciated, as I'm stuck after having tried out more than 100 odd times, with different filebeat/logstash configs.. For another file type (xml) I could successfully read the file though, so definitely filebeat-logstash are working.
filebeat.yml
### JSON configuration
json.message_key: "ApplicationName"
json.keys_under_root: true
json.add_error_key: true
### Multiline options
No multiline option enabled
output.logstash:
hosts: ["Logstash Server IP:5044"]
JSON Input file
{"ApplicationName": "xxxAPI","ApplicationVersion": "1.0.0","CorrelationId": "0e2a9ae5-57d8-
4868-80a2-43523a59bf6d","Data": "SomeException","Severity": "Error","TenantID":
"DevEnvironment","Time": "2021-02-17T18:12:37"}
Logstash yml config
input {
beats {
port => 5044
}
}
output {
#file { path => "C:\tmp\fileout\logstash.log" }
kusto {
path => "/tmp/kusto/%{+YYYY-MM-dd-HH-mm-ss}.txt"
ingest_url => "https://ingest-xxx.kusto.windows.net/"
app_id => "application id guid value"
app_key => "secret"
app_tenant => "tenant id guid"
database => "logstashdb"
table => "jsonfilelogs"
json_mapping => "jsonfilelogsmapping"
}
}
ADX table structure-mapping
.create table jsonfilelogs (ApplicationName: string, ApplicationVersion: string, CorrelationId: guid,
Data: string, Host: string, HostPrefix: string, Message: string, Severity: string,
TenantId: string, Timestamp: timespan)
.create table jsonfilelogs ingestion json mapping 'jsonfilelogsmapping' '[{"column":"ApplicationNa
me","Properties":{"path":"$.ApplicationName"}}, {"column":"ApplicationVersion","Properties"{"path":"$.ApplicationVersion"}}, {"column":"CorrelationId","Properties"{"path":"$.CorrelationId"}}, {"column":"Data","Properties"{"path":"$.Data"}}, {"column":"Host","Properties"{"path":"$.Host"}}, {"column":"HostPrefix","Properties"{"path":"$.HostPrefix"}}, {"column":"Message","Properties"{"path":"$.Message"}}, {"column":"Severity","Properties"{"path":"$.Severity"}}, {"column":"TenantId","Properties"{"path":"$.TenantId"}}, {"column":"Timestamp","Properties"{"path":"$.Timestamp"}}]' with '{"format":"multijson", "ingestionMappingReference":"FlatEventMapping"}'