Splunk Search

How do i extract field usinng regex .

bpot
Engager

Hi all,

I'm new to splunk and i had hard time extracting fields  using regex for the following example :
Class (six, seven)

Can someone help me with the above example , i want class as a field name and six,seven as two values for the field class.

Thanks for the help in Advance.

Labels (4)
0 Karma
1 Solution

thambisetty
SplunkTrust
SplunkTrust

| rex "Class\s+\((?<Class>[^\)]+)"

| makemv Class delim=","

| mvexpand Class

————————————
If this helps, give a like below.

View solution in original post

thambisetty
SplunkTrust
SplunkTrust

| rex "Class\s+\((?<Class>[^\)]+)"

| makemv Class delim=","

| mvexpand Class

————————————
If this helps, give a like below.

isoutamo
SplunkTrust
SplunkTrust

Good place to test these is https://regex101.com/

r. Ismo

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

New This Month - Observability Updates Give Extended Visibility and Improve User ...

This month is a collection of special news! From Magic Quadrant updates to AppDynamics integrations to ...

Intro to Splunk Synthetic Monitoring

In our last post, we mentioned that the 3 key pieces of observability – metrics, logs, and traces – provide ...