Splunk Search

A question about using the "collect" command.

noott211
Path Finder

index="my_index"
|eval check=if(html_code==200,"error","OK")
|stats count values(clientip) as src_ip by ip , check
|table src_ip , ip, check , count
|collect index=error_ip_count


I'm going to call up "error_ip_count" after using that command.
I used index=error_ip_count, but I couldn't call it up. Is there a wrong way to use it?

Labels (2)
Tags (1)
0 Karma
1 Solution

venkatasri
SplunkTrust
SplunkTrust

Hi @noott211 ,

Perhaps docs are starting point- https://docs.splunk.com/Documentation/Splunk/8.2.3/SearchReference/Collect

It depends on your use case and how you want to use it. At a high level it will write summary information( subset of _raw events) to a separate index.

View solution in original post

0 Karma

noott211
Path Finder

Thank you. Is there a better way to use collect?

0 Karma

venkatasri
SplunkTrust
SplunkTrust

Hi @noott211 ,

Perhaps docs are starting point- https://docs.splunk.com/Documentation/Splunk/8.2.3/SearchReference/Collect

It depends on your use case and how you want to use it. At a high level it will write summary information( subset of _raw events) to a separate index.

0 Karma

venkatasri
SplunkTrust
SplunkTrust

Hi @noott211 

What do you mean by you couldn't call it up?

The above query should work just fine if the index=error_ip_count exist on indexers otherwise you need to create it.

---

An upvote would be appreciated if this reply helps!

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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...