I have a JSON payload that's ingested through a REST API input on a heavy forwarder, with the following configuration in props.conf (on the heavy forwarder, not on the indexer): [json_result] ...
See more...
I have a JSON payload that's ingested through a REST API input on a heavy forwarder, with the following configuration in props.conf (on the heavy forwarder, not on the indexer): [json_result] INDEXED_EXTRACTIONS = json KV_MODE = none DATETIME_CONFIG = CURRENT SHOULD_LINEMERGE = false TRUNCATE = 200000 The ensuing event in Splunk looks like this (minified): {"totalCount":3,"nextPageKey":null,"result":[{"metricId":"builtin:synthetic.http.resultStatus","data":[{"dimensions":["HTTP_CHECK-02B087D58EC18C33","SUCCESS","SYNTHETIC_LOCATION-2CD023FA5F455E28"],"dimensionMap":{"Result status":"SUCCESS","dt.entity.synthetic_location":"SYNTHETIC_LOCATION-2CD023FA5F455E28","dt.entity.http_check":"HTTP_CHECK-02B087D58EC18C33"},"timestamps":[1639254360000],"values":[1]},{"dimensions":["HTTP_CHECK-02B087D58EC18C33","SUCCESS","SYNTHETIC_LOCATION-833A207E28766E49"],"dimensionMap":{"Result status":"SUCCESS","dt.entity.synthetic_location":"SYNTHETIC_LOCATION-833A207E28766E49","dt.entity.http_check":"HTTP_CHECK-02B087D58EC18C33"},"timestamps":[1639254360000],"values":[1]},{"dimensions":["HTTP_CHECK-02B087D58EC18C33","SUCCESS","SYNTHETIC_LOCATION-1D85D445F05E239A"],"dimensionMap":{"Result status":"SUCCESS","dt.entity.synthetic_location":"SYNTHETIC_LOCATION-1D85D445F05E239A","dt.entity.http_check":"HTTP_CHECK-02B087D58EC18C33"},"timestamps":[1639254360000],"values":[1]}]}]} The text in red reflects what I'm trying to extract from the payload; basically, it's three fields ("Result status", "dt.entity.synthetic_location" and "dt.entity.http_check") and their associated values. I'd like to have three events created from the payload, one event for each occurrence of the three fields, with the fields searchable in Splunk. I've tried this approach in props.conf to get what I'm looking for... [json_result] SHOULD_LINEMERGE = false LINE_BREAKER = }, DATETIME_CONFIG = CURRENT TRUNCATE = 0 SEDCMD-remove_prefix = s/{"totalCount":.*"nextPageKey":.*"result":\[{"metricId" :.*"data":\[//g SEDCMD-remove_dimensions = s/{"dimensions":.*"dimensionMap"://g SEDCMD-remove_timevalues = s/,"timestamps":.*"values":.*}//g SEDCMD-remove_suffix = s/\]}\]}//g ...but I'm only getting one set of fields to show up as an event in Splunk: And, the fields aren't showing up as "interesting fields" in the left navbar (possibly because the props.conf is not on the indexer?). Any assistance would be greatly appreciated. UPDATE: I referenced this post that's pretty close to what I'm trying to accomplish: https://community.splunk.com/t5/Getting-Data-In/How-to-split-a-json-array-into-multiple-events-with-separate/m-p/139851 The format of the JSON payload cited in this post is different than the format of the payload I'm using, though...so I'm guessing that some additional logic would be necessary to accommodate my format.