Splunk Dev

python script to pass results of a search to email recipient

underwoodjc
New Member

Was curious if anyone here uses a python script to pass the results of a search to a email recipient? I would appreciate a look at it to use for a similar purpose. I have a python mail script but not sure how to use it to send my search results.
thanks.

Tags (1)
0 Karma
1 Solution

LukeMurphey
Champion

Most of use the built-in sendemail command. You can configure the mail settings within the manager under System settings » Email alert settings.

View solution in original post

0 Karma

BobM
Builder

The easiest way is to send email is to use splunks built in "scheduled search", "alert" or the search command "sendmail" but if you want to do something non standard, you will need to write your own script. You can start with the one splunk uses. Make a copy if the following file and adjust to suit your needs.

$SPLUNK_HOME/etc/apps/search/bin/sendemail.py

0 Karma

LukeMurphey
Champion

Most of use the built-in sendemail command. You can configure the mail settings within the manager under System settings » Email alert settings.

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