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!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...