<?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: Issues with Lookup In Alert in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Issues-with-Lookup-In-Alert/m-p/54666#M13331</link>
    <description>&lt;P&gt;I managed to fix the problem I had above. I had to remove the initial | from the macro and then when called my macros using the search query place the | at the start i.e.:&lt;/P&gt;

&lt;P&gt;Macro Code - named mysearch:  &lt;/P&gt;

&lt;P&gt;inputlookup lookuptest | map [search source=SOURCE_A $Filter$ $Limit$ | stats avg(Timing) as Timing by TranName | where Timing &amp;gt;= $Duration$ ] maxsearches=99 | fields TranName, Timing&lt;/P&gt;

&lt;P&gt;Search String:&lt;/P&gt;

&lt;P&gt;| &lt;CODE&gt;mysearch&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Jan 2013 14:10:11 GMT</pubDate>
    <dc:creator>paddy3883</dc:creator>
    <dc:date>2013-01-07T14:10:11Z</dc:date>
    <item>
      <title>Issues with Lookup In Alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issues-with-Lookup-In-Alert/m-p/54662#M13327</link>
      <description>&lt;P&gt;I've created an lookup (lookuptest) from a CSV file which has three values per row e.g.  &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Filter,Limit,Timing&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;
VALUE1,"| head 5",1000&lt;BR /&gt;&lt;BR /&gt;
VALUE2,"",2000&lt;BR /&gt;&lt;BR /&gt;
VALUE3,"| head 10",3000  &lt;/P&gt;

&lt;P&gt;I've written a search using this lookup against events some a specific source SOURCE_A. Each event contains a number of fields including Timing (time in milliseconds for this event) and TranName (description of what event relates to). The search needs to read each row from the CSV, filter the events based on the values and then return the list e.g.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;inputlookup lookuptest | map [search source=SOURCE_A $Filter$ $Limit$ | stats avg(Timing) as Timing by TranName | where Timing &amp;gt;= $Duration$ ] maxsearches=99 | fields TranName, Timing&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;When I execute this in the Search application it runs as expected and returns the correct results, but when I create an alert for it based on this search it never finds any results. If I then View Recent executions of this search it loads the Search application but it has removed the variables e.g.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;inputlookup lookuptest | map [search source=SOURCE_A | stats avg(Timing) as Timing by TranName | where Timing &amp;gt;= ] maxsearches=99 | fields TranName, Timing&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Is there any reason for this?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2012 12:03:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issues-with-Lookup-In-Alert/m-p/54662#M13327</guid>
      <dc:creator>paddy3883</dc:creator>
      <dc:date>2012-12-05T12:03:28Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Lookup In Alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issues-with-Lookup-In-Alert/m-p/54663#M13328</link>
      <description>&lt;P&gt;I think you're hitting the fact that saved searches can have &lt;CODE&gt;$parameter$&lt;/CODE&gt; substition of their own. I believe a workaround is to place your search in a macro, and just have `macro_name` as your search&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2012 18:20:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issues-with-Lookup-In-Alert/m-p/54663#M13328</guid>
      <dc:creator>dart</dc:creator>
      <dc:date>2012-12-05T18:20:51Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Lookup In Alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issues-with-Lookup-In-Alert/m-p/54664#M13329</link>
      <description>&lt;P&gt;Thanks. Whenever I create the macro and attempt to run it in Search I get the following:&lt;/P&gt;

&lt;P&gt;Error in 'inputlookup' command: This command must be the first command of a search. My macro contains:&lt;/P&gt;

&lt;P&gt;| inputlookup lookuptest | map [search source=SOURCE_A $Filter$ $Limit$ | stats avg(Timing) as Timing by TranName | where Timing &amp;gt;= $Duration$ ] maxsearches=99 | fields TranName, Timing&lt;/P&gt;

&lt;P&gt;Any ideas what's going on?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2012 17:30:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issues-with-Lookup-In-Alert/m-p/54664#M13329</guid>
      <dc:creator>paddy3883</dc:creator>
      <dc:date>2012-12-06T17:30:33Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Lookup In Alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issues-with-Lookup-In-Alert/m-p/54665#M13330</link>
      <description>&lt;P&gt;Still struggling to figure out the problem with this one. Anyone have any idea what the issue is?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Dec 2012 11:21:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issues-with-Lookup-In-Alert/m-p/54665#M13330</guid>
      <dc:creator>paddy3883</dc:creator>
      <dc:date>2012-12-11T11:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Issues with Lookup In Alert</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issues-with-Lookup-In-Alert/m-p/54666#M13331</link>
      <description>&lt;P&gt;I managed to fix the problem I had above. I had to remove the initial | from the macro and then when called my macros using the search query place the | at the start i.e.:&lt;/P&gt;

&lt;P&gt;Macro Code - named mysearch:  &lt;/P&gt;

&lt;P&gt;inputlookup lookuptest | map [search source=SOURCE_A $Filter$ $Limit$ | stats avg(Timing) as Timing by TranName | where Timing &amp;gt;= $Duration$ ] maxsearches=99 | fields TranName, Timing&lt;/P&gt;

&lt;P&gt;Search String:&lt;/P&gt;

&lt;P&gt;| &lt;CODE&gt;mysearch&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2013 14:10:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issues-with-Lookup-In-Alert/m-p/54666#M13331</guid>
      <dc:creator>paddy3883</dc:creator>
      <dc:date>2013-01-07T14:10:11Z</dc:date>
    </item>
  </channel>
</rss>

