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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...