Splunk Search

How do I make splunk read one word as another?

BITSIntern
Path Finder

Hi guys,

I am inputting wordlists into splunk and in some of the wordlists there are certain words like "racist" and then "race" where they are similar.

My wordlists look like this:
race, 23
racist, 2
test, 12
testing, 22

Where "race" is in the field "word" and "23" is in the field "count".

I need to figure out a way to tell splunk to read "racist" and "race" as the same word such that when I create a dashboard in pivot where the x-axis is "word" and the y-axis is "count", the first 2 lines of my example are "race, 25" (making the x-axis say "race" and have the column reach to 25 on the y-axis).

I had done this before with ip addresses having splunk read the source and destination and make them add the count if they were the same but I can't figure this out.

If you know how to create a search such that this works please let me know! Also, if you do not fully understand what I am saying please feel free to ask for clarification.

Thanks!

Tags (3)
0 Karma

maciep
Champion

so something like this maybe?

.... | eval word = if (word="racist","race",word) | stats count by word

If you have more words to do something similar with, then maybe a case statement would be better than an if. And if you have a lot of words to worry about and they may be updating often, then a lookup might be best.

I don't do a whole lot with pivot myself, but I think you can use the above example to create an evaluated field maybe?

BITSIntern
Path Finder

That helped a lot but because the count for the words is in the actual document that I uploaded I need to use pivot so I can control the y-axis, but I don't think I can anymore since it created a statistical report. Do you have any other suggestions?

Thanks!

0 Karma

maciep
Champion

again, I don't do much with pivot. Did you create the data model? Or are you just using it? Do you have to use pivot or can you just search the data directly?

It's hard to really give you a good answer without better understanding the situation. But I'm sure there is a way to do this.

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 ...