Splunk Search

How to create a search to detect if no increase in the count of fields?

jakeoftrades
Explorer

hi,

can anyone help me how should I query the counts of kafka_datatype  of those stream_type which Im going to set an alert if there will be no increase within  3 hours within only a time period of time 7am-8pm 

I have this query :

 

index="pcg_p4_datataservices_prod" sourcetype="be:monitoring-services"
| setfields a=a
| rex "^[^\|\n]*\|\s+(?P<kafka_datatype>\w+)\s+\-\s+(?P<kafka_count>.+)"
| search kafka_datatype IN (PRODUCED, CONSUMED)
| search stream_type IN (Datascore_Compress, Datascore_Decompress, Eservices_Eload, Eservices_Ebills)
| eval service_details=stream_type
| timechart span=3h limit=0 sum(kafka_count) by service_details

 



I tried to add in the query for the earliest/latest (as -180m I guess for 3hrs) but not showing any result that Im aiming to set it  to detect that if for 3 hours if no increase in the count of kafka_datatype of those stream_type which Im going to set the alert:

 

index="pcg_p4_datataservices_prod" sourcetype="be:monitoring-services"
earliest=-180m
latest=now
| setfields a=a
| rex "^[^\|\n]*\|\s+(?P<kafka_datatype>\w+)\s+\-\s+(?P<kafka_count>.+)"
| search kafka_datatype IN (PRODUCED, CONSUMED)
| search stream_type IN (Datascore_Compress, Datascore_Decompress, Eservices_Eload, Eservices_Ebills)
| eval service_details=stream_type
| timechart span=3h limit=0 sum(kafka_count) by service_details

 

Labels (2)
Tags (2)
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...