<?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: inputlookup in macro in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/inputlookup-in-macro/m-p/25233#M233</link>
    <description>&lt;P&gt;Here's what is happening: Splunk is turning this query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`mySearch(bar)`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;into this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search `mySearch(bar)`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which is then expanded into this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search | inputlookup yada yada yada
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To get around this you need to move the pipe out of the macro and into the search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| `mySearch(bar)`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will make sure Splunk does not add the implicit &lt;CODE&gt;search&lt;/CODE&gt; command.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Aug 2013 06:56:43 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2013-08-06T06:56:43Z</dc:date>
    <item>
      <title>inputlookup in macro</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/inputlookup-in-macro/m-p/25231#M231</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have this search:&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;&lt;I&gt;| inputlookup mySearch | where foo=bar&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;Now I'd like to do this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;mySearch(bar)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;with &lt;I&gt;definition = | inputlookup mySearch | where foo=$bar$&lt;/I&gt;&lt;/P&gt;

&lt;P&gt;But it does not work.&lt;/P&gt;

&lt;P&gt;I get: &lt;STRONG&gt;Error in 'inputlookup' command: This command must be the first command of a search.&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;How can i use inputlookup in a macro?&lt;/P&gt;

&lt;P&gt;Regards, Jens&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2013 18:37:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/inputlookup-in-macro/m-p/25231#M231</guid>
      <dc:creator>JensT</dc:creator>
      <dc:date>2013-08-05T18:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: inputlookup in macro</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/inputlookup-in-macro/m-p/25232#M232</link>
      <description>&lt;P&gt;It happens because Splunk adds an search before MACRO, Savedsearch when it's called. So if you just mention the |inputlookup &lt;CODE&gt;macro(bar)&lt;/CODE&gt; then it will work. Thanks. There may be some other solution but i can tell this much.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2013 19:03:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/inputlookup-in-macro/m-p/25232#M232</guid>
      <dc:creator>linu1988</dc:creator>
      <dc:date>2013-08-05T19:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: inputlookup in macro</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/inputlookup-in-macro/m-p/25233#M233</link>
      <description>&lt;P&gt;Here's what is happening: Splunk is turning this query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`mySearch(bar)`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;into this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search `mySearch(bar)`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which is then expanded into this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search | inputlookup yada yada yada
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To get around this you need to move the pipe out of the macro and into the search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| `mySearch(bar)`
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will make sure Splunk does not add the implicit &lt;CODE&gt;search&lt;/CODE&gt; command.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Aug 2013 06:56:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/inputlookup-in-macro/m-p/25233#M233</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-08-06T06:56:43Z</dc:date>
    </item>
  </channel>
</rss>

