Splunk Search

Why am I unable to fetch data by using column names?

gunturu_nagasri
Explorer

Case 1:

index=xyz | rex "(?i)<ticketId>(?P<TICKETID>[^<;]+)"  | stats values(TICKETID) as TICKETID by processname | where TICKETID NOT NULL

TICKET ID - numeric eg : 23517727
processname - string eg : abc

I am trying to fetch TICKET ID details by distinct values of processname using the search above. It displays "no results found".

Case 2:
For the above search, if I remove the where clause, it displays both the processname and TICKETID columns where TICKETID column is empty.

Case 3:

index=xyz | rex "(?i)<ticketId>(?P<TICKETID>[^<]+)"  | stats values(TICKETID) as TICKETID by id | where TICKETID NOT NULL 

id - string eg: 143543337d5ea380261d5b318186dc4a28db9edb0

It gives me the results of distinct values of id with corresponding TICKETID values. I want the case 1 in this format.

-- id is a kind of primary key in this scenario where as processname isn't.

I am new in using splunk. Please do help me asap.

Thanks in advance 🙂

Tags (3)
0 Karma

woodcock
Esteemed Legend

Like this:

Case 1 and 2:

 index=xyz | rex "(?i)<ticketId>(?<TICKETID>[^<;]+)"  | stats values(TICKETID) as TICKETID by processname | where isnotnull(TICKETID)

Case 3:

 index=xyz | rex "(?i)<ticketId>(?<TICKETID>[^<]+)"  | stats values(TICKETID) as TICKETID by id | where isnotnull(TICKETID)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Please share some sample data so we can put your fields into context.

---
If this reply helps you, Karma would be appreciated.
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 ...