Hi Guys,
I am writing my logs in json file and and input filter is json directly but those are being parsed correctly in elasticsearch? Any clue what I am missing here?
Here is my json file
{"org_name": "google.com", "policy_spf": "pass", "org_email": "noreply-dmarc-support@google.com", "policy_dkim": "pass", "policy_pct": "100", "auth_spf_result": "pass","auth_dkim_domain": "xxx,ccc", "auth_dkim_result": "pass", "identifier_header_from": "xxx,ccc", "date_end": "2019-01-04T05:29:59", "date_start": "2019-01-03T05:30:00", "source_ip": "1,.2.3.4", "count": 1, "auth_spf_domain": "xxx,ccc", "policy_p": "none", "submitter": "unknown", "policy_disposition": "none", "policy_domain": "xxx,ccc", "id": "15325652754200102860"}
{âorg_nameâ: âgoogle.comâ, âpolicy_spfâ: âfailâ, âorg_emailâ: ânoreply-dmarc-support@google.comâ, âpolicy_dkimâ: âfailâ, âpolicy_pctâ: â100â, âauth_spf_resultâ: âpassâ, âidentifier_header_fromâ: âmail.xxx,cccâ, âdate_endâ: â2019-01-04T05:29:59â, âdate_startâ: â2019-01-03T05:30:00â, âsource_ipâ: â2.3.4.5â, âcountâ: 1, âauth_spf_domainâ: âapc01-hk2-obe.outbound.protection.outlook.comâ, âpolicy_pâ: ânoneâ, âsubmitterâ: âunknownâ, âpolicy_dispositionâ: ânoneâ, âpolicy_domainâ: âxxx,cccâ, âidâ: â15325652754200102860â}
{âorg_nameâ: âgoogle.comâ, âpolicy_spfâ: âpassâ, âorg_emailâ: ânoreply-dmarc-support@google.comâ, âpolicy_dkimâ: âpassâ, âpolicy_pctâ: â100â, âauth_spf_resultâ: âpassâ, âauth_dkim_domainâ: âxxx,cccâ, âauth_dkim_resultâ: âpassâ, âidentifier_header_fromâ: âxxx,cccâ, âdate_endâ: â2019-01-04T05:29:59â, âdate_startâ: â2019-01-03T05:30:00â, âsource_ipâ: â2.2.2.2â, âcountâ: 1, âauth_spf_domainâ: âxxx,cccâ, âpolicy_pâ: ânoneâ, âsubmitterâ: âunknownâ, âpolicy_dispositionâ: ânoneâ, âpolicy_domainâ: âxxx,cccâ, âidâ: â15325652754200102860â}
And here is my logstash config file which is not parsing the JSON logs correctly. Can someone confirm what is the issue?
input {
file {
type => âjsonâ
path => â/log/*.jsonâ
start_position => âbeginningâ
}
}
filter {
if [source_type] == "json-logs" {
json {
source => "message"
tag_on_failure => ["_jsonparsefailure"]
}
}
}
output {
gelf {
host => âlocalhostâ
port => â12202â
protocol => âUDPâ
}
}