<?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: Can you help me do an outputlookup with a condition? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-do-an-outputlookup-with-a-condition/m-p/401029#M116135</link>
    <description>&lt;P&gt;many thanks&lt;/P&gt;</description>
    <pubDate>Fri, 23 Nov 2018 06:05:16 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2018-11-23T06:05:16Z</dc:date>
    <item>
      <title>Can you help me do an outputlookup with a condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-do-an-outputlookup-with-a-condition/m-p/401027#M116133</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I use the code below.&lt;/P&gt;

&lt;P&gt;I'm doing an outputlookup at the end of the query, but I want to do it with a condition.&lt;/P&gt;

&lt;P&gt;The condition is that Build=1511.&lt;/P&gt;

&lt;P&gt;Do i have to use a where command or there is another solution please??&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eventtype="AppliEV" Level=* 
| dedup host 
| stats count by host 
| append 
    [ search index="ai-wkst-windows-fr" sourcetype=WinRegistry key_path="\\registry\\machine\\xx" 
        OR 
        key_path="\\registry\\machine\\xx" 
    | eval OS=if(key_path=="\\registry\\machine\\software\\xx), 
        Build=if(key_path=="\\registry\\machine\\software\\xx) 
    | stats latest(OS) as OS latest(Build) as Build by host ] 
| stats values(OS) as OS values(Build) as Build by host 
| stats count as Total by OS Build host | fields - host | outputlookup build.csv
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Nov 2018 07:00:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-do-an-outputlookup-with-a-condition/m-p/401027#M116133</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-11-22T07:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me do an outputlookup with a condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-do-an-outputlookup-with-a-condition/m-p/401028#M116134</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;

&lt;P&gt;You can use a &lt;CODE&gt;where&lt;/CODE&gt; command in this way:&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
 ...&lt;BR /&gt;
    | stats count as Total by OS Build host &lt;BR /&gt;
    | fields - host&lt;BR /&gt;
    | appendpipe&lt;BR /&gt;
        [where Build="1511" &lt;BR /&gt;
        | outputlookup override_if_empty=f build.csv&lt;BR /&gt;
        | where nofield="novalue"]&lt;BR /&gt;
&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;It helps to avoid overriding build.csv with empty file in case of Build is not 1511.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 22:06:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-do-an-outputlookup-with-a-condition/m-p/401028#M116134</guid>
      <dc:creator>nryabykh</dc:creator>
      <dc:date>2020-09-29T22:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me do an outputlookup with a condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-do-an-outputlookup-with-a-condition/m-p/401029#M116135</link>
      <description>&lt;P&gt;many thanks&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 06:05:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-do-an-outputlookup-with-a-condition/m-p/401029#M116135</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2018-11-23T06:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me do an outputlookup with a condition?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-do-an-outputlookup-with-a-condition/m-p/401030#M116136</link>
      <description>&lt;P&gt;This is awesome! Thank you. &lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2019 12:32:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-do-an-outputlookup-with-a-condition/m-p/401030#M116136</guid>
      <dc:creator>grittonc</dc:creator>
      <dc:date>2019-04-08T12:32:26Z</dc:date>
    </item>
  </channel>
</rss>

