Splunk Search

SPL Query

SabariRajanT
Path Finder

Hello Team,

I have my service now ticketing logs enabled into my splunk. I do required  a below help and suggestions.

Look at the ticketing status goes like "draft" "Recover" "Cancelled" "Analysis"  "Closed" 

Suppose ticket #2345 starts with draft then goes on recover then to analysis then to closed state

Here we go to pull current status of the ticket #2345 in splunk search by below SPL query for last 24hours.

index=main source=xyz dv_state=* dv_opened_by=pox OR dv_opened_by=IOP |dedup number dv_state |TABLE number dv_state,dv_opened by, dv_opened_at

Search answer: I am getting ticket status 2345 as "draft". But actually ticket is in closed state.

Am looking  #2345 ticket should show only in closed state. let me know what went wrong.

My expectation : If the #2345 ticket went through closed state what will be the spl query for last 24hours.?

 

Labels (1)
0 Karma
1 Solution

saravanan90
Contributor

We can use stats with last. 

index=main source=xyz dv_state=* dv_opened_by=pox OR dv_opened_by=IOP | stats last(dv_state) last(otherfields) by number

View solution in original post

saravanan90
Contributor

We can use stats with last. 

index=main source=xyz dv_state=* dv_opened_by=pox OR dv_opened_by=IOP | stats last(dv_state) last(otherfields) by number

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...