Hello, I need help with perfecting a sourcetype that doesn't index my json files correctly when I am defining multiple capture groups within the LINE_BREAKER parameter. I'm using this other quest...
See more...
Hello, I need help with perfecting a sourcetype that doesn't index my json files correctly when I am defining multiple capture groups within the LINE_BREAKER parameter. I'm using this other questionto try to figure out how to make it work: https://community.splunk.com/t5/Getting-Data-In/How-to-handle-LINE-BREAKER-regex-for-multiple-capture-groups/m-p/291996 In my case my json looks like this [{"Field 1": "Value 1", "Field N": "Value N"}, {"Field 1": "Value 1", "Field N": "Value N"}, {"Field 1": "Value 1", "Field N": "Value N"}] Initially I tried: LINE_BREAKER = }(,\s){ Which split the events with the exception of the first and last records which were not indexed correctly due to the "[" or "]" characters leading and trailing the payload. After many attempts I have been unable to make it work, but based on what I've read this seems to be the most intuitive solution for defining the capture groups: LINE_BREAKER = ^([){|}(,\s){|}(])$ It doesn't work, but rather indexes the entire payload as one event, formatted correctly, but unusable. Could somebody please suggest how to correctly define the LINE_BREAKER parameter for the sourcetype? Here is the full version I'm using: [area:prd:json] SHOULD_LINEMERGE = false TRUNCATE = 8388608 TIME_PREFIX = \"Updated\sdate\"\:\s\" TIME_FORMAT = %Y-%m-%d %H:%M:%S TZ = Europe/Paris MAX_TIMESTAMP_LOOKAHEAD = -1 KV_MODE = json LINE_BREAKER = ^([){|}(,\s){|}(])$ Other resolutions to my problem are welcome as well! Best regards, Andrew