Alerting

How do I add host and description of error code in telegram alert?

sphiwee
Contributor

I have the below query for an alert, but the result does not add host or description in the result, how can i achieve this?

 

sphiwee_0-1658678846219.png

 

Labels (3)
Tags (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

There are two reasons why the host and description fields are not shown.

1) The stats command removed them.  stats is a transforming command that only passes on the field explicitly mention - in this case count and status.

2) The table command only displays the caption field.

The fixes for host are pretty straightforward - add the field to the stats and table commands.

... | stats count by host, status
...
| table host, caption

Adding the description field likely can be done in a similar manner, but the screenshot tells us nothing about that field so it's hard to say for sure.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

There are two reasons why the host and description fields are not shown.

1) The stats command removed them.  stats is a transforming command that only passes on the field explicitly mention - in this case count and status.

2) The table command only displays the caption field.

The fixes for host are pretty straightforward - add the field to the stats and table commands.

... | stats count by host, status
...
| table host, caption

Adding the description field likely can be done in a similar manner, but the screenshot tells us nothing about that field so it's hard to say for sure.

---
If this reply helps you, Karma would be appreciated.
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 ...