Splunk Search

How to add values to the fields?

ramesh12345
Explorer

Hi,

 index="osh" sourcetype="Service" CaseNumber=1111 status=* assignment_group=*
| dedup _time,CaseNumber,assignment_group 
| streamstats current=f last(assignment_group) as lg, last(active) as Active by CaseNumber 
| lookup Team.csv SO as sys_updated_by OUTPUT TeamName 
| eval is_escalated= if(assignment_group!=lg AND assignment_group="OSM L1",1,NULL) 
| eval is_resolved=if(assignment_group="OSM L1" AND status="Complete" AND (isnull(Active) OR Active="true"),1,NULL) 
| stats count(is_escalated) AS "Escalated Cases" count(is_resolved) AS "Resolved Cases" by sys_updated_by,TeamName 
| fields - TeamName

alt text

when i run this query it is displaying like that(attached image).

For that case number(1111) 2 members worked.so this case resolved case so the output should be 1 for two members.

if it is escalated cases then in escalated cases i should should assign 1.

How to do this?

Tags (1)
0 Karma

rsathish47
Contributor

Hi ,
you can use streamstats command for this

index=_internal | stats count by sourcetype | head 2| streamstats current=f last(count) as newcount

Thanks
Sathish R

0 Karma

ramesh12345
Explorer

Could you please send me the final query.i am little bit confused.

0 Karma

nickhills
Ultra Champion

You should post your searches using the code tool (icon which looks like 101010 ) I think some of the characters of your search have been stripped. - I edited this for you.

If my comment helps, please give it a thumbs up!
0 Karma
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!

Mastering Threat Intelligence in ES 8.5, Splunk AI Assistant v2, and More from Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

Break the Build: Inside the KubeDoom Lounge at .conf26

    You step up to the machine. The pixelated corridors of a certain 1993 FPS load in front of you, EMP Pulse ...

Splunk Auto Ingestion Parallel Pipeline Scaling

Why this feature matters Many Splunk environments experience ingestion pressure long before the host is fully ...