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
Get Updates on the Splunk Community!

Prove Your Splunk Prowess at .conf25—No Prereqs Required!

Your Next Big Security Credential: No Prerequisites Needed We know you’ve got the skills, and now, earning the ...

Splunk Observability Cloud's AI Assistant in Action Series: Observability as Code

This is the sixth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Answers Content Calendar, July Edition I

Hello Community! Welcome to another month of Community Content Calendar series! For the month of July, we will ...