<?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: How to update lookup using macro? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-lookup-using-macro/m-p/428724#M122648</link>
    <description>&lt;P&gt;確かにappend=tで元ファイルを取り込んで、dedupするみたいなサーチで実現はできるんですが、macroの動作仕様が気になるので、別途質問しようかと思います…。&lt;/P&gt;</description>
    <pubDate>Thu, 14 Mar 2019 06:11:24 GMT</pubDate>
    <dc:creator>yutaka1005</dc:creator>
    <dc:date>2019-03-14T06:11:24Z</dc:date>
    <item>
      <title>How to update lookup using macro?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-lookup-using-macro/m-p/428720#M122644</link>
      <description>&lt;P&gt;When I want to update lookup using search like below, it updates lookup table even if there is no results, but I want to avoid it.&lt;BR /&gt;
&lt;CODE&gt;~ | outputlookup sample.csv&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;So, I was thinking that I can do it by using macro, and configured like below, but it didn't work.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Definition&lt;BR /&gt;
&lt;CODE&gt;outputlookup sample.csv&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Arguments&lt;BR /&gt;
&lt;CODE&gt;arg&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Validation Expression&lt;BR /&gt;
&lt;CODE&gt;isnotnull($arg$)&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Validation Error Message&lt;BR /&gt;
&lt;CODE&gt;result is null !&lt;/CODE&gt;&lt;BR /&gt;
For example, in the sample search shown below, the field "result" is passed to the macro and the field is null, so I thought that I would get an error, but I did not get an error.&lt;/P&gt;

&lt;P&gt;| makeresults count=1 &lt;BR /&gt;
| &lt;CODE&gt;macro(result)&lt;/CODE&gt;&lt;BR /&gt;
How can I do it? If someone know about it, please tell me.&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 12 Mar 2019 05:05:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-update-lookup-using-macro/m-p/428720#M122644</guid>
      <dc:creator>yutaka1005</dc:creator>
      <dc:date>2019-03-12T05:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to update lookup using macro?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-lookup-using-macro/m-p/428721#M122645</link>
      <description>&lt;P&gt;Hi @yutaka1005&lt;/P&gt;

&lt;P&gt;Check this link, similar question by @niketnilay&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/488470/macro-with-validation-isnum-does-not-work-even-if.html"&gt;https://answers.splunk.com/answers/488470/macro-with-validation-isnum-does-not-work-even-if.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Mar 2019 06:34:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-update-lookup-using-macro/m-p/428721#M122645</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-12T06:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to update lookup using macro?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-lookup-using-macro/m-p/428722#M122646</link>
      <description>&lt;P&gt;Thank you for answer.&lt;/P&gt;

&lt;P&gt;But in that Answers, problem wasn't solved.&lt;BR /&gt;
I do not know the reason after all, but it ended with the conclusion that &lt;CODE&gt;isnum()&lt;/CODE&gt; function did not work well.&lt;/P&gt;

&lt;P&gt;I wonder how some functions such as &lt;CODE&gt;isnull ()&lt;/CODE&gt;, &lt;CODE&gt;isnum ()&lt;/CODE&gt; and &lt;CODE&gt;isnotnull ()&lt;/CODE&gt; do not work well with macros.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 04:23:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-update-lookup-using-macro/m-p/428722#M122646</guid>
      <dc:creator>yutaka1005</dc:creator>
      <dc:date>2019-03-14T04:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to update lookup using macro?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-lookup-using-macro/m-p/428723#M122647</link>
      <description>&lt;P&gt;マクロの仕様ではなく、LOOKUPファイルを上書きしない方法の回答です。&lt;/P&gt;

&lt;P&gt;サーチの中で元ファイルを１回追加で読み込んで、サーチ結果が０件でない場合は追加したデータを削除する動きは可能だと思います。&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 04:51:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-update-lookup-using-macro/m-p/428723#M122647</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2019-03-14T04:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to update lookup using macro?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-update-lookup-using-macro/m-p/428724#M122648</link>
      <description>&lt;P&gt;確かにappend=tで元ファイルを取り込んで、dedupするみたいなサーチで実現はできるんですが、macroの動作仕様が気になるので、別途質問しようかと思います…。&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2019 06:11:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-update-lookup-using-macro/m-p/428724#M122648</guid>
      <dc:creator>yutaka1005</dc:creator>
      <dc:date>2019-03-14T06:11:24Z</dc:date>
    </item>
  </channel>
</rss>

