Splunk Search

How to create a table?

minpd0309
Explorer

HI, I want to make the log below in the form of the table below. What should I do with the spl?

 

[log ex] 

14:39:19.857 INF [md_system_user] remove success [user id:kimkimkim] by [id:tom]

 

[table]

user id id
kimkimkim tom
Labels (1)
Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @minpd0309,

you have to extract (using a regex) the fields and then run something like this:

index=your_index
| rex "\[user id:(?<user_id>\w+)\]\s+by\s+\[id:(?<id>\w+)"
| table user_id id

you can test the regex at https://regex101.com/r/HUeULf/1

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @minpd0309,

you have to extract (using a regex) the fields and then run something like this:

index=your_index
| rex "\[user id:(?<user_id>\w+)\]\s+by\s+\[id:(?<id>\w+)"
| table user_id id

you can test the regex at https://regex101.com/r/HUeULf/1

Ciao.

Giuseppe

Get Updates on the Splunk Community!

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...