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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...