Splunk Search

How do you make a regex to extract the following value?

abhishekgandhe
Explorer

Hi,

I want to extract a value from the following line:

systemGuid=9516e36a-e5e9-4ec5-a449-edcaeb5f227f,

I need the value between systemGuid= and comma (,) at the end. I am looking for value 9516e36a-e5e9-4ec5-a449-edcaeb5f227f from the above line.

0 Karma
1 Solution

493669
Super Champion

Try this:

|rex "systemGuid=(?<GUID>[^,]+)"

View solution in original post

0 Karma

SathyaNarayanan
Path Finder

Hi,

You can use the below regex.

systemGuid=(?.*),

It will regex till comma.

0 Karma

abhishekgandhe
Explorer

It has given me everything coming after systemGuid=. I just want value between = and comma.
systemGuid=9516e36a-e5e9-4ec5-a449-edcaeb5f227f,

The actual string where I am extracting the value is this: -

systemGuid=9516e36a-e5e9-4ec5-a449-edcaeb5f227f, calculationName=Data Reconciliation, pointId=fi_12101_01.pv_ag, batchId=, modelId=model-cps-kkru-qa2, unisimModelName=CPS_PLATF_R, epochUTC=1543310100000, itemValue=372891.642424334, itemValueStr=null, quality=Good, timeOffset=P0000)","severityLevel":"Informational","timestamp":"2018-11-27T09:31:11+00:00","sourceType":"LOGBack","loggerName":"com.honeywell.pmt.cps.dao.RcDataPointDaoImpl","level":"INFO","threadName":"Thread-19"}],"internal":{"data":{"id":"2d554756-f227-11e8-b34a-1953e7591063","documentVersion":"1.61"}},"context":{"data":{"eventTime":"2018-11-27T09:31:11.027Z","isSynthetic":false,"samplingRate":100.0},"device":{"id":"2d52dcf8e7d2","type":"PC","osVersion":"Linux","roleInstance":"2d52dcf8e7d2","deviceName":"Other","deviceModel":"Other","locale":"en-US","browser":"Apache-HttpClient","browserVersion":"Apache-HttpClient 4.5","screenResolution":{}},"user":{"isAuthenticated":false},"session":{"isFirst":false},"operation":{},"location":{"clientip":"0.0.0.0","continent":"North America","country":"United States","province":"Virginia","city":"Boydton"},"custom":{"dimensions":[{"LoggerName":"com.honeywell.pmt.cps.dao.RcDataPointDaoImpl"},{"LoggingLevel":"INFO"},{"SourceType":"LOGBack"},{"ThreadName":"Thread-19"},{"TimeStamp":"Tue,

0 Karma

493669
Super Champion

Try this:

|rex "systemGuid=(?<GUID>[^,]+)"
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...