Alerting

how to change default alert smtp port?

robmcq
Engager

C:\Program Files\Splunk\Python-2.6\Lib\smtpd.py??

Tags (1)

southeringtonp
Motivator

You probably want to avoid tampering with default Python libraries. If you're only concerned with scheduled alerts, then I think you can just do the following in alert_actions.conf:

[email]
mailserver=mail.example.com:587

This doesn't appear to affect emails sent via the search pipeline (i.e., using | sendemail) -- for that you would still have to call your search like this:

search xxx | sendemail to=myaddress@example.com server=mail.example.com:587

But the big advantage is you don't have to do anything "unusual".


If you really want to change the overall default, you'll most likely have to modify the sendemail.py in the search app, which has a hard-coded default of "localhost". Overriding the sendemail script may break things, especially during version upgrades. For example, supporting PDF emails release in 4.1 required changes to that script. You have been warned....

  • Copy apps/search/bin/sendemail.py to sendemail-local.py
  • Around line 51, modify the default value of "server" like so:
  •     serverURL  = argvals.get("server", "mail.example.com:587")
    

  • Edit apps/search/local/commands.conf to activate your new script:
  • [sendemail]
    filename = sendemail-local.py
    
    Career Survey
    First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
    Get Updates on the Splunk Community!

    Tech Talk Recap | Mastering Threat Hunting

    Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

    Observability for AI Applications: Troubleshooting Latency

    If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

    Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

    In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...