Getting Data In

How to read a number, then convert to corresponding string and stats table?

bryceweb22
Path Finder

I am trying to extract a module/level ID from my logs and have splunk take that ID and match it to the corresponding name from a csv file and put that into a stats table, please help.

Thanks!

0 Karma
1 Solution

sandeepmakkena
Contributor

YourSearch | rex field=_raw max_match=0 "level ID":\"(?< ID>\d+)\""
| lookup file.csv level ID as ID OUTPUT corresponding_name
| table corresponding_name count

Save your .csv to lookup folder

file.csv

ID corresponding_name
1 A
2 B

This should work.

View solution in original post

0 Karma

sandeepmakkena
Contributor

YourSearch | rex field=_raw max_match=0 "level ID":\"(?< ID>\d+)\""
| lookup file.csv level ID as ID OUTPUT corresponding_name
| table corresponding_name count

Save your .csv to lookup folder

file.csv

ID corresponding_name
1 A
2 B

This should work.

0 Karma

starcher
Influencer
0 Karma
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 ...