<?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 append=true vs append [|inputlookup ] behavior difference in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305629#M91732</link>
    <description>&lt;P&gt;This is a bug/feature of the search optimizer, in this particular case it's doing projection elimination - removing evals it thinks are unnecessary. To confirm, check the job inspector for optimizedSearch that only contains two inputlookups, but no eval.&lt;/P&gt;

&lt;P&gt;The field will magically reappear if it's used later in the search, alternatively add &lt;CODE&gt;| table *&lt;/CODE&gt; if you just want to see it now... or &lt;CODE&gt;| noop search_optimization=false&lt;/CODE&gt;, or &lt;CODE&gt;| eval foo = flag&lt;/CODE&gt; will also make it appear.&lt;BR /&gt;
This is still happening in 7.0.2, make sure to file a support case to check if this is intentional behaviour or a bug.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/Search/Built-inoptimization#Projection_elimination"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/Search/Built-inoptimization#Projection_elimination&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 25 Feb 2018 00:56:03 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2018-02-25T00:56:03Z</dc:date>
    <item>
      <title>Inputlookup append=true vs append [|inputlookup ] behavior difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305623#M91726</link>
      <description>&lt;P&gt;I saw a &lt;A href="https://answers.splunk.com/answers/583462/inputlookup-append-search-vs-search-append-inputlo.html?utm_source=typeahead&amp;amp;utm_medium=newquestion&amp;amp;utm_campaign=no_votes_sort_relev"&gt;previous question&lt;/A&gt; dealing with this, but that question never got an accepted answer, and I think it was sufficiently complex that this distillation may highlight the issue more directly. I observed unexpected behavior when testing approaches using &lt;CODE&gt;| inputlookup append=true ...&lt;/CODE&gt; vs &lt;CODE&gt;| append [| inputlookup ... ]&lt;/CODE&gt;. Here are a series of screenshots documenting what I found.&lt;/P&gt;

&lt;P&gt;I created two small test csv files: &lt;CODE&gt;first_file.csv&lt;/CODE&gt; and &lt;CODE&gt;second_file.csv&lt;/CODE&gt;. They each contain three fields: &lt;CODE&gt;_time&lt;/CODE&gt;, &lt;CODE&gt;row&lt;/CODE&gt;, and &lt;CODE&gt;file_source&lt;/CODE&gt;. I tested this code first:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup first_file.csv
| eval flag="this is from the first file" 
| append 
 [| inputlookup second_file.csv ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This displayed what I expected:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4431i5F0EEAC3337894EB/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Then I tested this code snippet:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup first_file.csv
| eval flag="this is from the first file" 
| inputlookup append=true second_file.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Somehow, this causes the &lt;CODE&gt;flag&lt;/CODE&gt; field to disappear, as you can see here:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4432iA31CC20E5CD6C7C7/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Is this expected? I couldn't find anything in the docs to explain the difference in behavior. If it is expected, is there a flag or attribute I can set when using the &lt;CODE&gt;| inputlookup append=true&lt;/CODE&gt; approach that would preserve fields?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 22:10:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305623#M91726</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-02-22T22:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup append=true vs append [|inputlookup ] behavior difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305624#M91727</link>
      <description>&lt;P&gt;What version of Splunk are you testing it in? I don't see this behavior (flag field getting removed) in 6.2 and 6.3 instance that I can check right now. Also, what do you get when you run this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1
 | eval flag="this is from the first file" 
 | inputlookup append=true second_file.csv
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Feb 2018 22:27:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305624#M91727</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-02-22T22:27:03Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup append=true vs append [|inputlookup ] behavior difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305625#M91728</link>
      <description>&lt;P&gt;I'm running Splunk 6.6.2.&lt;BR /&gt;
Here's the output of that command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;endhuman    starttime   starthuman  endtime flag
Wed Feb 21 23:59:59 2018    1519189200  Wed Feb 21 00:00:00 2018    1519275599  this is from the first file
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Feb 2018 22:34:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305625#M91728</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-02-22T22:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup append=true vs append [|inputlookup ] behavior difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305626#M91729</link>
      <description>&lt;P&gt;Nothing is getting added from yoru second_file.csv lookup?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2018 22:39:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305626#M91729</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-02-22T22:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup append=true vs append [|inputlookup ] behavior difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305627#M91730</link>
      <description>&lt;P&gt;Sorry, I was in a rush out the door last night and accidentally ran your suggested tests with outputlookup instead of inputlookup, hence the nonsense. Fully caffeinated and not in a rush, here's the real results. &lt;/P&gt;

&lt;P&gt;CODE: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 
| eval flag="this is from the first file" 
| inputlookup append=true second_file.csv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OUTPUT:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;endtime endhuman    starthuman  starttime   _time   file_source row
1519361999  Thu Feb 22 23:59:59 2018    Thu Feb 22 00:00:00 2018    1519275600           
                2018-02-23 11:45:44 second  1
                2018-02-23 11:45:44 second  2
                2018-02-23 11:45:44 second  3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Easier to see/parse:&lt;BR /&gt;
&lt;A href="https://imgur.com/82CmsKh"&gt;https://imgur.com/82CmsKh&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 16:51:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305627#M91730</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-02-23T16:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup append=true vs append [|inputlookup ] behavior difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305628#M91731</link>
      <description>&lt;P&gt;Also, for what it's worth, our ops team upgraded everything from 6.6.2 to 6.6.5 last night, and I'm still seeing the same behavior.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2018 17:36:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305628#M91731</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-02-23T17:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup append=true vs append [|inputlookup ] behavior difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305629#M91732</link>
      <description>&lt;P&gt;This is a bug/feature of the search optimizer, in this particular case it's doing projection elimination - removing evals it thinks are unnecessary. To confirm, check the job inspector for optimizedSearch that only contains two inputlookups, but no eval.&lt;/P&gt;

&lt;P&gt;The field will magically reappear if it's used later in the search, alternatively add &lt;CODE&gt;| table *&lt;/CODE&gt; if you just want to see it now... or &lt;CODE&gt;| noop search_optimization=false&lt;/CODE&gt;, or &lt;CODE&gt;| eval foo = flag&lt;/CODE&gt; will also make it appear.&lt;BR /&gt;
This is still happening in 7.0.2, make sure to file a support case to check if this is intentional behaviour or a bug.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/Search/Built-inoptimization#Projection_elimination"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/Search/Built-inoptimization#Projection_elimination&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Feb 2018 00:56:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305629#M91732</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2018-02-25T00:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Inputlookup append=true vs append [|inputlookup ] behavior difference</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305630#M91733</link>
      <description>&lt;P&gt;You're right! Thank you. It was causing me some confusion while trying to troubleshoot a more complex use case, but I can understand why it would be a "feature" here.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Feb 2018 17:18:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inputlookup-append-true-vs-append-inputlookup-behavior/m-p/305630#M91733</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-02-26T17:18:09Z</dc:date>
    </item>
  </channel>
</rss>

