Splunk Search

How to send field as Token in Alerts

LizAndy123
Path Finder

So I have my Query working and I have a webhook created in a Channel

It says that I can send Tokens when I send the Alert - It says the Message can include tokens that insert text based on the result of search query

My Field / Label I created was Total_Count

How do I pass that as a Token?

Labels (1)
0 Karma
1 Solution

PickleRick
SplunkTrust
SplunkTrust

https://docs.splunk.com/Documentation/Splunk/latest/Alert/EmailNotificationTokens#Result_tokens

You need to use $result.your_field_name$ in your case it will be $result.Total_Count$

View solution in original post

LizAndy123
Path Finder

I have a follow up on this or should I start again?

I can send the token and it works, but I am doing a search where one of the fields is a sum 

Example stats sum(SizeGB)

What the search is doing is getting the total number of Data uploaded for a Project and the report works great however I was want to send the figure as a token in the alert - I can send the project id but not the sum - I have tried $testresult.sum(SizeGB)$ and also I did an eval of the Sum and called it total_size and tried that as a token and it is just blank.

0 Karma

PickleRick
SplunkTrust
SplunkTrust

https://docs.splunk.com/Documentation/Splunk/latest/Alert/EmailNotificationTokens#Result_tokens

You need to use $result.your_field_name$ in your case it will be $result.Total_Count$

LizAndy123
Path Finder

Thanks, worked great

0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...