<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Alert Actions: How to set alert.email.from value dynamically based on host? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Alert-Actions-How-to-set-alert-email-from-value-dynamically/m-p/448586#M7889</link>
    <description>&lt;P&gt;hi mate, as mentioned in my question.. though doc says like that, host is not getting appending automatically&lt;/P&gt;</description>
    <pubDate>Tue, 30 Oct 2018 22:42:28 GMT</pubDate>
    <dc:creator>koshyk</dc:creator>
    <dc:date>2018-10-30T22:42:28Z</dc:date>
    <item>
      <title>Alert Actions: How to set alert.email.from value dynamically based on host?</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-Actions-How-to-set-alert-email-from-value-dynamically/m-p/448584#M7887</link>
      <description>&lt;P&gt;As per Splunk documentation for savedsearches.conf  the action.email.from can be set to ensure the "From" address is filled up. &lt;BR /&gt;
The default value in alert_actions.conf  &lt;CODE&gt;from&lt;/CODE&gt; is &lt;CODE&gt;splunk&lt;/CODE&gt;  when i run the btool.&lt;/P&gt;

&lt;P&gt;How to change this to &lt;CODE&gt;splunk@$LOCALHOST&lt;/CODE&gt; ? (though document says it is the default, in reality it is just "splunk")&lt;BR /&gt;
When i put the value as &lt;CODE&gt;splunk@$LOCALHOST&lt;/CODE&gt;  it throws error as  "Invalid Address" in python.log&lt;/P&gt;

&lt;P&gt;(OR any REST interface for this?)&lt;/P&gt;

&lt;P&gt;Same issue exists on Splunk 6.4.x,6.5.x,6.6.x&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 13:12:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-Actions-How-to-set-alert-email-from-value-dynamically/m-p/448584#M7887</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2018-10-29T13:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: Alert Actions: How to set alert.email.from value dynamically based on host?</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-Actions-How-to-set-alert-email-from-value-dynamically/m-p/448585#M7888</link>
      <description>&lt;P&gt;Hi @koshyk,&lt;/P&gt;

&lt;P&gt;If you look at &lt;CODE&gt;$SPLUNK_HOME/etc/system/default/alert_actions.conf&lt;/CODE&gt;, it is saying that hostname will be automatically appended from mailserver&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# from email address (name only, host will be appended automatically from mailserver)

from=splunk
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Oct 2018 14:13:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-Actions-How-to-set-alert-email-from-value-dynamically/m-p/448585#M7888</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-10-29T14:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: Alert Actions: How to set alert.email.from value dynamically based on host?</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-Actions-How-to-set-alert-email-from-value-dynamically/m-p/448586#M7889</link>
      <description>&lt;P&gt;hi mate, as mentioned in my question.. though doc says like that, host is not getting appending automatically&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 22:42:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-Actions-How-to-set-alert-email-from-value-dynamically/m-p/448586#M7889</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2018-10-30T22:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Alert Actions: How to set alert.email.from value dynamically based on host?</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-Actions-How-to-set-alert-email-from-value-dynamically/m-p/448587#M7890</link>
      <description>&lt;P&gt;Can you please let us know what value are you getting in &lt;CODE&gt;From&lt;/CODE&gt; in your mailbox when Email alert has been fired ? Additionally how you configured splunk to send email alert ?&lt;/P&gt;

&lt;P&gt;In my lab environment I didn't configured Email Settings in Splunk so by default it use &lt;CODE&gt;localhost&lt;/CODE&gt; as mailserver (Config in alert_actions.conf &lt;CODE&gt;mailserver = localhost&lt;/CODE&gt;) and on server postfix is running as mailserver so splunk use postfix to send email alert. Now in postfix it captures  hostname from &lt;CODE&gt;myhostname&lt;/CODE&gt; parameter in &lt;CODE&gt;/etc/postfix/main.cf&lt;/CODE&gt;, if you do not set anything then it will use Linux function &lt;CODE&gt;gethostname()&lt;/CODE&gt; to set &lt;CODE&gt;myhostname&lt;/CODE&gt; parameter. If I specifically set &lt;CODE&gt;myhostname = test.example.com&lt;/CODE&gt; then splunk will send alert (with default configuration) with from field as &lt;CODE&gt;splunk@test.example.com&lt;/CODE&gt; so you need to check on your mailserver what hostname it is providing.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 11:06:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-Actions-How-to-set-alert-email-from-value-dynamically/m-p/448587#M7890</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2018-10-31T11:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Alert Actions: How to set alert.email.from value dynamically based on host?</title>
      <link>https://community.splunk.com/t5/Alerting/Alert-Actions-How-to-set-alert-email-from-value-dynamically/m-p/448588#M7891</link>
      <description>&lt;P&gt;it just comes as "splunk"   (with no hostname)&lt;BR /&gt;
hostname is set and I can see the JIRA addon sends email correctly. It is the default splunk alert which has the issue&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 12:55:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Alert-Actions-How-to-set-alert-email-from-value-dynamically/m-p/448588#M7891</guid>
      <dc:creator>koshyk</dc:creator>
      <dc:date>2018-10-31T12:55:31Z</dc:date>
    </item>
  </channel>
</rss>

