<?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 Variable substitution not working in correlation search? in Splunk Enterprise Security</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Variable-substitution-not-working-in-correlation-search/m-p/475502#M7456</link>
    <description>&lt;P&gt;I have a correlation search for detecting when host stops sending logs. I enabled the search and set the title as below but when I receive the notables, my results show the hostname of the search head as the $host$ instead of the actual host who stopped sending logs. When I expand the notable, it does show the correct host under the "Additional Fields" section, just not in the title of the notable. The $Latest_Time$ doesn't work either, I'm not sure if it's possible to even use that or what I would have to put so it shows the Latest_Time / Last Time Reported field.  Any help would be greatly appreciated!&lt;/P&gt;

&lt;P&gt;Title of correlation search: &lt;BR /&gt;
"Host $host$ stopped sending logs since $Latest_Time$"&lt;/P&gt;

&lt;P&gt;Query:&lt;BR /&gt;
&lt;CODE&gt;| metadata type=hosts index=*| where relative_time(now(), "-1d") &amp;gt; lastTime AND  lastTime &amp;gt; relative_time(now(), "-90d") | convert ctime(lastTime) as Latest_Time | sort -lastTime | table host,Latest_Time | lookup asset_lookup_by_str nt_host AS host OUTPUTNEW priority AS priority,bunit AS bunit |rename Latest_Time AS "Last Time Reported"&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 05:00:26 GMT</pubDate>
    <dc:creator>tromero3</dc:creator>
    <dc:date>2020-09-30T05:00:26Z</dc:date>
    <item>
      <title>Variable substitution not working in correlation search?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Variable-substitution-not-working-in-correlation-search/m-p/475502#M7456</link>
      <description>&lt;P&gt;I have a correlation search for detecting when host stops sending logs. I enabled the search and set the title as below but when I receive the notables, my results show the hostname of the search head as the $host$ instead of the actual host who stopped sending logs. When I expand the notable, it does show the correct host under the "Additional Fields" section, just not in the title of the notable. The $Latest_Time$ doesn't work either, I'm not sure if it's possible to even use that or what I would have to put so it shows the Latest_Time / Last Time Reported field.  Any help would be greatly appreciated!&lt;/P&gt;

&lt;P&gt;Title of correlation search: &lt;BR /&gt;
"Host $host$ stopped sending logs since $Latest_Time$"&lt;/P&gt;

&lt;P&gt;Query:&lt;BR /&gt;
&lt;CODE&gt;| metadata type=hosts index=*| where relative_time(now(), "-1d") &amp;gt; lastTime AND  lastTime &amp;gt; relative_time(now(), "-90d") | convert ctime(lastTime) as Latest_Time | sort -lastTime | table host,Latest_Time | lookup asset_lookup_by_str nt_host AS host OUTPUTNEW priority AS priority,bunit AS bunit |rename Latest_Time AS "Last Time Reported"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:00:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Variable-substitution-not-working-in-correlation-search/m-p/475502#M7456</guid>
      <dc:creator>tromero3</dc:creator>
      <dc:date>2020-09-30T05:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: Variable substitution not working in correlation search?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Variable-substitution-not-working-in-correlation-search/m-p/475503#M7457</link>
      <description>&lt;P&gt;I'm not sure why &lt;CODE&gt;$host$&lt;/CODE&gt; is not working, but &lt;CODE&gt;$Latest_Time$&lt;/CODE&gt; doesn't work because there is no such field.  It's renamed to &lt;CODE&gt;$Last Time Reported$&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 20:54:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Variable-substitution-not-working-in-correlation-search/m-p/475503#M7457</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-04-13T20:54:21Z</dc:date>
    </item>
    <item>
      <title>Re: Variable substitution not working in correlation search?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Variable-substitution-not-working-in-correlation-search/m-p/475504#M7458</link>
      <description>&lt;P&gt;Okay I changed the $Latest_Time$ to $Last Time Reported$ and that part is now fixed.  Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 21:07:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Variable-substitution-not-working-in-correlation-search/m-p/475504#M7458</guid>
      <dc:creator>tromero3</dc:creator>
      <dc:date>2020-04-13T21:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Variable substitution not working in correlation search?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Variable-substitution-not-working-in-correlation-search/m-p/475505#M7459</link>
      <description>&lt;P&gt;So it looks like the issue was that I needed to use $orig_host$ to get the original host from the actual events.  $host$ was just getting the search head hostname (maybe due to the metadata command?).&lt;/P&gt;</description>
      <pubDate>Wed, 15 Apr 2020 15:12:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Variable-substitution-not-working-in-correlation-search/m-p/475505#M7459</guid>
      <dc:creator>tromero3</dc:creator>
      <dc:date>2020-04-15T15:12:58Z</dc:date>
    </item>
    <item>
      <title>Re: Variable substitution not working in correlation search?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise-Security/Variable-substitution-not-working-in-correlation-search/m-p/613870#M11045</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/39047"&gt;@tromero3&lt;/a&gt;&amp;nbsp; &amp;nbsp;I ran into the very same issue with $host$ not working . Pls advise how did you come up with $orig_host$ field ?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 04:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise-Security/Variable-substitution-not-working-in-correlation-search/m-p/613870#M11045</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2022-09-21T04:21:59Z</dc:date>
    </item>
  </channel>
</rss>

