Splunk Search

How to edit my timechart search to find how many fields were processed in a given time span?

prashanthberam
Explorer

i have table like this

id            info            starttime    endtime      responsetime    source
2             inbound         time1        time2        1sec            raja
              outbound
3             inbound         time3        time4        3 sec           raja1
              outbound

i need to find out the timechart; like in 1 hr, how many id's were processed in 24 hrs
i am trying to do timechart span=1h count(id) by source
but I am getting error, could someone please help me?
thanks.

0 Karma
1 Solution

somesoni2
Revered Legend

Try this (check the rex command as it was truncated in your comments)

index=**** source="****" "getProcedureDetailBlueChip" OR "getProcedureDetailBlueChipResponse" AND 
 "Outbound Message" OR "Inbound Message" OR "getProcedureDetailBlueChip response time returning procedure details" OR "memZipCode assigned to zipCode" OR 
 "provZipCode assigned to zipCode" OR "Begin getProcedureDetailBluChip"|rex "(?Inbound|Outbound)" | rex "ID:(?.*)" 
 |rex "(?m)\(?.*)"|rex "(?m)\(?.*)" | timechart span=1h dc(id) by source

View solution in original post

0 Karma

somesoni2
Revered Legend

Try this (check the rex command as it was truncated in your comments)

index=**** source="****" "getProcedureDetailBlueChip" OR "getProcedureDetailBlueChipResponse" AND 
 "Outbound Message" OR "Inbound Message" OR "getProcedureDetailBlueChip response time returning procedure details" OR "memZipCode assigned to zipCode" OR 
 "provZipCode assigned to zipCode" OR "Begin getProcedureDetailBluChip"|rex "(?Inbound|Outbound)" | rex "ID:(?.*)" 
 |rex "(?m)\(?.*)"|rex "(?m)\(?.*)" | timechart span=1h dc(id) by source
0 Karma

somesoni2
Revered Legend

The timechart command requires field _time to be present in the resultset. Which field can be used to calculate _time?

0 Karma

prashanthberam
Explorer
index=**** source="****" "getProcedureDetailBlueChip" OR "getProcedureDetailBlueChipResponse" AND 
"Outbound Message" OR "Inbound Message" OR "getProcedureDetailBlueChip response time returning procedure details" OR "memZipCode assigned to zipCode" OR 
"provZipCode assigned to zipCode" OR "Begin getProcedureDetailBluChip"|rex "(?Inbound|Outbound)" | rex "ID:(?.*)" 
|rex "(?m)\(?.*)"|rex "(?m)\(?.*)"
|stats max(_time) as startTime,min(_time) as endTime,values(info) as Info,values(ResponseTime) as responseTime,values(StatusCode) as StatusCode,values(message) as StatusMessage by id,source
|eval responseTime=startTime-endTime |eval StartTime=strftime(startTime,"%Y-%m-%d %H:%M:%S,%3N")|eval EndTime=strftime(endTime,"%Y-%m-%d %H:%M:%S,%3N")
|table id,Info,StartTime,EndTime,responseTime,StatusCode,StatusMessage,source

my query like this i am trying to put the _time field in it , could you please suggest me..thanks...

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...