All Apps and Add-ons

How to generate an alert based on new database table entry?

cjs1031
Explorer

I am new to Splunk, very green. I have a DB search that I need to run and I have the search string I need but when I setup an alert, the alert is checking the results and sending them all to me. Basically, each time a new entry hits that table I need it to send me an email with just the new entrie(s). I imagine this is very simple to do but again, I am green. Here is my string.

index=main sourcetype=trims_tblXUsersRoles_audit xcomp_access_role_id=3 | stats values(user_id) as userID by Action_date,Action,xcomp_access_role_id,create_login
0 Karma

the_wolverine
Champion

Trying specifying a timerange either in your query syntax, then schedule the search to run every hour:

e.g.
index=main sourcetype=trims_tblXUsersRoles_audit xcomp_access_role_id=3 earliest=-1h latest=now | stats values(user_id) as userID by Action_date,Action,xcomp_access_role_id,create_login

In configuration, set the alert to email when there are greater than 0 events.

0 Karma

cjs1031
Explorer

Hi thanks!

Actually I found more to this, so there is a different column I need to base this on "create_date". So I think you are on the right track so something like this:
index=main sourcetype=trims_tblXUsersRoles_audit xcomp_access_role_id=3 create_date="" | stats values(user_id) as userID by Action_date,Action,xcomp_access_role_id,create_login,create_date

What can I do with the "create_date" to pickup the newest creation date when this job runs every 5mins?

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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