All Apps and Add-ons

Change background color of specifc column in email alert table

AKG1_old1
Builder

Hello,

I am using sendresults app for email alert. In results table I have one column name as count. I want if any row having count value > 0 then its background color should be red.
alt text

This is the default CSS for results table. Not sure if possible implement my requirement.

table {font-family:Arial;font-size:12px;border: 1px solid black;padding:3px}th {background-color:#4F81BD;color:#fff;border-left: solid 1px #e9e9e9} td {border:solid 1px #e9e9e9}
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

@agoyal

I think you have to do some changes in $SPLUNK_HOME/etc/apps/search/bin/sendemail.py (Make sure about this should be done by someone who knows python very well).

Here I suggest making a copy of this script with another name in your app-level bin directory. ( $SPLUNK_HOME/etc/apps/MY_APP/bin/new_sendemail.py )

Now you need point this script by creating $SPLUNK_HOME/etc/apps/MY_APP/local/commands.conf

You will need a [sendemail] section to point to your new script.

[sendemail]
filename = new_sendemail.py
streaming = false
run_in_preview = false

Put your alerts in this app and try this solution.

Make sure your alerts have proper HTML and inline CSS content.

Thanks

0 Karma

mockd
Path Finder

Hi,

Unfortunately that is not possible right now in the current version. CSS doesn't allow you to select by inner HTML values, so more info/attributes would need to be added to the generated HTML to make it work.

This is an interesting idea for a new feature for the app and will add it to our feature list. We are hoping to have a new version out in time for .conf.

Thanks,
Derek.

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 ...