Splunk Search

chart count over in splunk

surekhasplunk
Communicator
| rest /services/authentication/users splunk_server=local | search [| rest /services/authentication/current-context | rename username as title | fields title] |fields realname |map[|inputlookup mpc.csv |chart count over "Sub Division 4" by "Enrollment Status" | eval Enrolled=if(isnotnull(Enrolled),Enrolled,0) | eval In-Progress=if(isnotnull('In-Progress'),'In-Progress',0) |eval Completed=if(isnotnull(Completed),Completed,0)| eval total='Completed'+'Enrolled'+'In-Progress' |eval %Completed=round(('Completed'/('total'))*100,2) |eval %Enrolled=round((Enrolled/('total'))*100,2)|eval "%In-Progress"=round(('In-Progress'/('total'))*100,2) |rename total as "Total Employee Count" "Sub Division 4" as "Business Area"| fields "Business Area" "Supervisor Name" "Total Employee Count" %Enrolled "%In-Progress" %Completed]

Currently am using above query which is showing me all the enrollment status values by business area but in addition to that i want to search the realname in the mpc.csv file in the column "supervisor Name" and display it.
how to do that ?

Tags (2)
0 Karma

somesoni2
Revered Legend

Try like this

|inputlookup mpc.csv 
| where 'Supervisor Name'=[| rest /services/authentication/current-context splunk_server=local | table realname | rename realname as search | format] | eval "Sub Division 4"='Sub Division 4'."##".'Supervisor Name'
|chart count over "Sub Division 4" by "Enrollment Status" 
| eval Enrolled=if(isnotnull(Enrolled),Enrolled,0) | eval In-Progress=if(isnotnull('In-Progress'),'In-Progress',0) |eval Completed=if(isnotnull(Completed),Completed,0)
| eval total='Completed'+'Enrolled'+'In-Progress' |eval %Completed=round(('Completed'/('total'))*100,2) 
|eval %Enrolled=round((Enrolled/('total'))*100,2)|eval "%In-Progress"=round(('In-Progress'/('total'))*100,2) 
| rex field="Sub Division 4" "(?<SubDiv>[^#]+)##(?<Supervisor>.+)"
|rename total as "Total Employee Count" "SubDiv" as "Business Area" Supervisor as "Supervisor Name"| fields "Business Area" "Supervisor Name" "Total Employee Count" %Enrolled "%In-Progress" %Completed
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...