Splunk Search

count the specific items from the list in Splunk

Shashank_87
Explorer

Hi, I have a list column with different values and i want to count the number of occurence of a specific value. For example I have a column temp which contain list of values like below -

temp
/review-basket
/review-basket
/review-basket
/check-your-details

Now what i want another column with a count of the occurence of /review-basket which in the above case is 3.

Any help is appreciated.

0 Karma

apoorvaarbooj
Engager

... | stats count by temp

0 Karma

vnravikumar
Champion

Hi

Try with

.....|eventstats count by temp
0 Karma

Shashank_87
Explorer

@vnravikumar I think you misunderstood. The temp column I am getting by using stats like below -

| stats min(_time) as _time, list(req_content) as temp, count(req_content) as total by uniqueId

Now, that temp column has details like above I mentioned in the question. I need another column with the count of /review-basket in the temp column.

0 Karma

rmmiller
Contributor

@Shashank_87, is your expected output is supposed to look like this?

temp count
/review-basket 3
/review-basket 3
/review-basket 3
/check-your-details 1

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...