<?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: Lookup command returning incorrect null values and values for another entry in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450019#M127429</link>
    <description>&lt;P&gt;The only version of the 7.2.* stream of Splunk that is production-stable is the newly released v7.2.4.  No previous versions of 7.2.* should be used in production due to devastating bugs like this one.&lt;/P&gt;</description>
    <pubDate>Tue, 12 Feb 2019 02:33:34 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-02-12T02:33:34Z</dc:date>
    <item>
      <title>Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450008#M127418</link>
      <description>&lt;P&gt;I encountered a very weird behaviour. This has now also been reported as bug.&lt;/P&gt;

&lt;P&gt;Update: I did manage to create some fake data now and further isolated the issue. I cannot attach the files nor links. So you'd need to create them on your own.&lt;/P&gt;

&lt;P&gt;So first run this to create some fake logs:&lt;/P&gt;

&lt;P&gt;| makeresults | eval id=1 | eval number=  816341959&lt;BR /&gt;
| append [|makeresults | eval id=1 | eval number=816295885]&lt;BR /&gt;
| fields - _time&lt;BR /&gt;
| outputlookup testlog.csv&lt;/P&gt;

&lt;P&gt;And now  run this to create a lookup:&lt;BR /&gt;
| makeresults | eval color="Purple" | eval number=816295885 | fields - _time &lt;BR /&gt;
| outputlookup testlookup.csv&lt;/P&gt;

&lt;P&gt;Now that we got the files, run this:&lt;/P&gt;

&lt;P&gt;|inputlookup testlog.csv&lt;BR /&gt;
| eval number=mvindex(number,0,0)&lt;BR /&gt;
| lookup testlookup.csv number output color as color1&lt;BR /&gt;
| eval mydump=number&lt;BR /&gt;
| eval mydump2=color&lt;BR /&gt;
| eventstats dc(test.id) as ids by number&lt;BR /&gt;
| lookup testlookup.csv number output color as color2&lt;BR /&gt;
| search number=816295885&lt;/P&gt;

&lt;P&gt;Result: &lt;BR /&gt;
color1 is null&lt;BR /&gt;
color2 is "Purple" as it should be&lt;/P&gt;

&lt;P&gt;Things you can play around with:&lt;BR /&gt;
- Remove the mvindex -&amp;gt; it will populate color1 correctly&lt;BR /&gt;
- Remove the eventstats -&amp;gt; it will populate color1 correctly (even though there is nothing which affects this field at that point)&lt;BR /&gt;
- in the testlog.csv switch around the two values -&amp;gt; it will populate color1 correctly&lt;BR /&gt;
- switch the value which is NOT looked up (816341959) to 100 -&amp;gt; it will populate color1 correctly (from 816295885)&lt;BR /&gt;
- now switch the value which is NOT looked up to 916341959 -&amp;gt;  it will populate color1 correctly (from 816295885)&lt;/P&gt;

&lt;P&gt;This basically means that with numbers in this range of ~816295885 splunk becomes unreliable, if it is at a location of a similar lookup, which is extremely bad.&lt;/P&gt;

&lt;P&gt;You can even do this:&lt;BR /&gt;
| makeresults | eval number= 816295885&lt;BR /&gt;
| append [ makeresults | eval number=816341959]&lt;BR /&gt;
| table number&lt;BR /&gt;
| lookup testlookup.csv number output color&lt;/P&gt;

&lt;P&gt;Even though only 816295885 is in the lookup, the color will also be found for 816341959, which is even more extremely bad I guess.&lt;/P&gt;

&lt;P&gt;Splunk Version 7.2 was used in this case. Don't know if this is version specific.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2019 15:54:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450008#M127418</guid>
      <dc:creator>Bastelhoff</dc:creator>
      <dc:date>2019-02-09T15:54:04Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450009#M127419</link>
      <description>&lt;P&gt;Hi @Bastelhoff ,&lt;/P&gt;

&lt;P&gt;Could you please explain what is your desire with putting &lt;CODE&gt;[|inputlookup listofnumbers.csv | fields number]&lt;/CODE&gt; to the beginning of your initial search?&lt;BR /&gt;
If you say that &lt;CODE&gt;listofnumbers.csv&lt;/CODE&gt; contains 10000 values, this subsearch&lt;CODE&gt;[|inputlookup listofnumbers.csv | fields number]&lt;/CODE&gt; will return nothing.&lt;BR /&gt;
If you make your subsearch look like this: &lt;CODE&gt;[|inputlookup listofnumbers.csv | fields number | return number]&lt;/CODE&gt; - it will append &lt;CODE&gt;number="&amp;lt;the "number" value of the first row in listofnumbers.csv file&amp;gt;"&lt;/CODE&gt; to your main search.&lt;BR /&gt;
If you make your subsearch look like this: &lt;CODE&gt;[|inputlookup listofnumbers.csv | fields number | format]&lt;/CODE&gt; - subsearch will append all values of "number" field in your file in this way: ( ( number="1" ) OR ( number="2" ) OR ( number="3" ) OR ... ( number="10000" ) ).&lt;BR /&gt;
I mean to say, that your main search might be incorrect and this is the reason you get incorrect results.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Feb 2019 19:09:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450009#M127419</guid>
      <dc:creator>pkarpushin</dc:creator>
      <dc:date>2019-02-09T19:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450010#M127420</link>
      <description>&lt;P&gt;Do you have a reproducing data set to share?&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 00:44:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450010#M127420</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2019-02-10T00:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450011#M127421</link>
      <description>&lt;P&gt;Thanks! listofnumbers contains about 5000 values. It would work with 11000 as well, but would be cropped to 10k in this case (and therefore give incomplete results). The main search will however find more than one instance per number.&lt;/P&gt;

&lt;P&gt;But you are right that my example here was incorrect. Due to the dedup which was placed before the first lookup it would have been reduced down to the initial value (at max). So I adjusted the code.&lt;/P&gt;

&lt;P&gt;That said I was not aware of your workaround. I am using a multivalue field with modulo 10000 usually, so that I get 10000 entries (cap) with zero to X values, expanding it to basically endless (unless the time cap breaks it).&lt;/P&gt;

&lt;P&gt;I will do some more tests today and hopefully have a more detailed/conclusive example during the next 12h.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 05:47:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450011#M127421</guid>
      <dc:creator>Bastelhoff</dc:creator>
      <dc:date>2019-02-10T05:47:03Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450012#M127422</link>
      <description>&lt;P&gt;Unfortunately I cannot share the original data and I am unable to reproduce fake data which comes to the same result. I just updated the issue description though.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 15:35:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450012#M127422</guid>
      <dc:creator>Bastelhoff</dc:creator>
      <dc:date>2019-02-10T15:35:11Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450013#M127423</link>
      <description>&lt;P&gt;So... removing the eventstats from your search changes the values of &lt;CODE&gt;color&lt;/CODE&gt;? That feels weird.&lt;BR /&gt;
Do post the values of optimizedSearch from the job inspector for both cases.&lt;/P&gt;

&lt;P&gt;This would be much easier if you had shareable reproducing data. Can't you anonymize your data?&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 15:42:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450013#M127423</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2019-02-10T15:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450014#M127424</link>
      <description>&lt;P&gt;I checked the job inspector regarding the optimized search. &lt;BR /&gt;
In the case where it does not work it changes the following:&lt;BR /&gt;
| search test.number=500 becomes | search "test.number"=500&lt;BR /&gt;
and this line goes one line up before the second lookup. Also both evals are put together.&lt;BR /&gt;
No other changes besides of adding quotation marks around the first file name and "test.number" as shown above.&lt;/P&gt;

&lt;P&gt;In the case where I removed the eventstats the | search "test.number"=500 goes up all the way until it is right below the mvindex line. No other differences to the other one (besides of the missing line now obviously)&lt;/P&gt;

&lt;P&gt;So far I failed to create fake data which worked.&lt;BR /&gt;
The fields are identical though:&lt;BR /&gt;
test.number - has same name structure with dot, and is a number (and in these cases not a multi value field. However it can happen that due to issues it becomes a multivalue field, hence the mvindex to remove duplicate entries)&lt;BR /&gt;
test.id - also same name structure with dot and is a number&lt;BR /&gt;
color - has same name structure and is a string&lt;/P&gt;

&lt;P&gt;I can replicate it with an initial csv as input which has ~17k entries&lt;BR /&gt;
The real dictionary uses identical names (hence test.number) and has ~3500 entries&lt;/P&gt;</description>
      <pubDate>Sun, 10 Feb 2019 16:20:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450014#M127424</guid>
      <dc:creator>Bastelhoff</dc:creator>
      <dc:date>2019-02-10T16:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450015#M127425</link>
      <description>&lt;P&gt;There are definitely strange bugs when you recycle field names using multi-valued fields and the &lt;CODE&gt;mv*&lt;/CODE&gt; commands.  Also, field names with spaces or periods are evil.  Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup faketestlogs.csv
| eval test_number=mvindex('test.number',0)
| fields - $test.number$
| lookup fakedictionary.csv test_number output color
| eval mydump=test_number
| eval mydump2=color
| eventstats dc(test.id) AS num_ids BY test_number
| lookup fakedictionary.csv test_number output color AS color2
| search test_number=500
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, it is poor form (and produces warnings) to use lookup files directly.  You should create a lookup definition and use that instead.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 07:26:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450015#M127425</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-11T07:26:59Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450016#M127426</link>
      <description>&lt;P&gt;I did these changes (including cutting one ,0) but it did not change anything.&lt;BR /&gt;
I also tried both | fields - $test.number$ (which didnt remove the field) and | fields - test.number, which did remove the field, but it did not have any impact on the final result.&lt;/P&gt;

&lt;P&gt;ofc I still had to add the old name in the lookup as this is the name of the field there.&lt;BR /&gt;
So it was in this example | lookup fakedictionary.csv test.number as test_number output color&lt;/P&gt;

&lt;P&gt;Whether the lookup definition or the csv files are used directly makes no difference in this case. But as lookup definitions can have some additional rules associated with them I decided to go with the .csv directly in this example to exclude additional sources of the problem.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 09:13:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450016#M127426</guid>
      <dc:creator>Bastelhoff</dc:creator>
      <dc:date>2019-02-11T09:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450017#M127427</link>
      <description>&lt;P&gt;I ran your three test searches, and get both color and color2 as Purple, Splunk 7.2.3.&lt;BR /&gt;
Ran the final search, only get one row with Purple as it should be.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 23:04:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450017#M127427</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2019-02-11T23:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450018#M127428</link>
      <description>&lt;P&gt;Tried it in 7.1.2 now which is working as well. &lt;BR /&gt;
7.2.1 however is broken.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 02:17:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450018#M127428</guid>
      <dc:creator>Bastelhoff</dc:creator>
      <dc:date>2019-02-12T02:17:37Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450019#M127429</link>
      <description>&lt;P&gt;The only version of the 7.2.* stream of Splunk that is production-stable is the newly released v7.2.4.  No previous versions of 7.2.* should be used in production due to devastating bugs like this one.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 02:33:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450019#M127429</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-12T02:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup command returning incorrect null values and values for another entry</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450020#M127430</link>
      <description>&lt;P&gt;Update then &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 07:39:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-command-returning-incorrect-null-values-and-values-for/m-p/450020#M127430</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2019-02-12T07:39:53Z</dc:date>
    </item>
  </channel>
</rss>

