Splunk Search

How to make a search sentence

honobe
Explorer

For each subject in the search sentence, the count number is displayed.
In addition to the information currently being displayed, I want to display the attached file name for each subject.

The search sentence you are using is below.
※ Partially omitted

index=xxxxx
| lookup ~ommitted~
| stats count ~ommitted~ by subject

Can I display the attached file name by adding it to the search sentence that is counting?

-image table-

Subject---Number---attached file name---Number of Mail with Attachment

AAAA---100--- aaaa---10
BBBB---50---none---0
CCCC---200---cccc---200

In the current search searches, only the subject line and number of items are displayed.
*I want to display none if there is no attached file.

Tags (1)
0 Karma
1 Solution

Richfez
SplunkTrust
SplunkTrust
index=xxxxx
| lookup ~ommitted~
| stats count values("attached file name") ~ommitted~ by subject

Or list("attached file name") would work too. List gets you ALL of the values in order, values gets something more like a distinct list of file names. You can try both and see which fits your needs better.

Happy Splunking,
Rich

View solution in original post

0 Karma

Richfez
SplunkTrust
SplunkTrust
index=xxxxx
| lookup ~ommitted~
| stats count values("attached file name") ~ommitted~ by subject

Or list("attached file name") would work too. List gets you ALL of the values in order, values gets something more like a distinct list of file names. You can try both and see which fits your needs better.

Happy Splunking,
Rich

0 Karma

honobe
Explorer

Thanks to your answer, I was able to solve the problem.

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!

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