0

i have data as "{\"data\":{\"correlation_id:\"51g0d88f-3ab8-4mom-betb-b31ed6e1662z\",\"u_originator_uri in _raw. i want to extract values of correlation_id as CorrelationId4

Dshruti
  • 11
  • 1

1 Answers1

0

Best to use a JSON parser to easily extract a field, such as JSON.parse(_raw).data.correlation_id will return the value of correlation_id.

I do not have splunk to test, but try this if you want to use the rex splunk command with a regular expression:

rex field=_raw "correlation_id:.\"(?<CorrelationId4>.*?).\""

Detail docs at https://docs.splunk.com/Documentation/Splunk/8.1.1/SearchReference/Rex

Peter Thoeny
  • 7,379
  • 1
  • 10
  • 20