<?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: Bizarre bug with &amp;quot;head&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501047#M139534</link>
    <description>&lt;P&gt;Ah okay... so when you fixed this, your search returned results?&lt;/P&gt;</description>
    <pubDate>Sat, 12 Oct 2019 00:03:01 GMT</pubDate>
    <dc:creator>bojanjanisch</dc:creator>
    <dc:date>2019-10-12T00:03:01Z</dc:date>
    <item>
      <title>Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501040#M139527</link>
      <description>&lt;P&gt;1) My boss goes to upload a small .csv to my indexer&lt;BR /&gt;
2) My boss goes to search the .csv from my search head. Results are returned&lt;BR /&gt;
3) My boss adds &lt;CODE&gt;head 250&lt;/CODE&gt; to the query and nothing else. Zero results are returned&lt;/P&gt;

&lt;P&gt;This behavior does not occur copying and pasting the exact same searches to the indexer. I can reproduce the same behavior and have restarted my search head without any luck. Obviously this is a bug that needs to be fixed, but I would also like to know why &lt;CODE&gt;head&lt;/CODE&gt; would produce this behavior.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 17:28:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501040#M139527</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2019-10-11T17:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501041#M139528</link>
      <description>&lt;P&gt;Please share the working and non-working queries.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 17:46:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501041#M139528</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-10-11T17:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501042#M139529</link>
      <description>&lt;P&gt;Nick 10:53 AM&lt;BR /&gt;
its because he tabled the same value twice. but I still don't know why head would affect it if the non-head results don't)&lt;/P&gt;

&lt;P&gt;Bojan Janisch 10:54 AM&lt;BR /&gt;
To me it looks like a bug in SimpleResultsCombiner&lt;BR /&gt;
Due to the fact that head is a centralized streaming command, the SimpleResultsCombiner is executed in order to merge event results... however altough you are using index=... you are not getting events, but csv or tabled results...&lt;BR /&gt;
If you apply head on an indexer, it runs in distributed streaming mode... meaning that SimpleResultsCombiner is not executed&lt;/P&gt;

&lt;P&gt;Nick 10:58 AM&lt;BR /&gt;
but you should be able to run head on a search head for an indexed csv, correct? i mean you're intended to upload csvs into an index.&lt;/P&gt;

&lt;P&gt;Bojan Janisch 11:00 AM&lt;BR /&gt;
Yes... even though... each event in an index should always have 4 fields... _time, sourcetype, source and host...&lt;BR /&gt;
you need to make sure that your indexed csvs rows become events&lt;BR /&gt;
Make sure that there is a _time column in your csv&lt;/P&gt;

&lt;P&gt;Nick 11:04 AM&lt;BR /&gt;
i still think this is a very unexpected behavior. it's a very simple thing that I did (upload csv and search) and even as a 2yr full-time splunk developer I didn't know i had to make my csvs events in order to use head&lt;BR /&gt;
so people e.g. my boss would never know to do this&lt;/P&gt;

&lt;P&gt;Bojan Janisch 11:06 AM&lt;BR /&gt;
Yes they could point to missing _time fields in your csv during index process&lt;/P&gt;

&lt;P&gt;@bojanjanisch &lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 18:07:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501042#M139529</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2019-10-11T18:07:47Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501043#M139530</link>
      <description>&lt;P&gt;To clarify the issue a bit:&lt;/P&gt;

&lt;P&gt;@nick405060 is running a distributed Splunk environment. He indexed a CSV-file with no &lt;CODE&gt;_time&lt;/CODE&gt; field and wanted to output the first 250 rows but he always got 0 results. So his search was looking something like  &lt;CODE&gt;search index=abc source=test.csv | head 250 | table a, b, c, d&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;We researched the search.logs a bit and found an interesting entry like &lt;CODE&gt;"SimpleResultsCombiner - 236 events were discarded due to a missing or invalid _time field"&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;However when he changed the search to "index=abc source=test.csv | table a,b,c,d | head 250" he got the results. He also got results if the first search was executed on an indexer. But if he executed it on a SearchHead, he never got results. So the issue must've originated somewhere in the distributed search mode.&lt;/P&gt;

&lt;P&gt;So my guess is that if "head" is applied after a base search (with no reporting commands in between), the centralized streaming mode (&lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.2/SearchReference/Commandsbytype"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.2/SearchReference/Commandsbytype&lt;/A&gt;) first calls the SimpleResultsCombiner trying to merge/sort events by _time field. However there is no _time field in the CSV, so events are getting skipped. If we apply it on an indexer or after a reporting command, it'll use the distributed streaming mode, which does not seem to call SimpleResultsCombiner. Or maybe it does but not trying to merge/sort results as events by _time and therefore does not skip them.&lt;/P&gt;

&lt;P&gt;Maybe there's some explanation from the Splunk devs regarding this issue and how we could avoid these in the future?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 18:33:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501043#M139530</guid>
      <dc:creator>bojanjanisch</dc:creator>
      <dc:date>2019-10-11T18:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501044#M139531</link>
      <description>&lt;P&gt;I think you may have totally missed the doubly tabled field mentioned in our conversation.&lt;/P&gt;

&lt;P&gt;Clearly that was the root cause of the issue here, but &lt;/P&gt;

&lt;P&gt;1) Why should a doubly tabled field break a &lt;CODE&gt;head 250&lt;/CODE&gt; search but not a non-headed search?&lt;BR /&gt;
2) Why should a doubly tabled field break a SH &lt;CODE&gt;head 250&lt;/CODE&gt; search but not an IN &lt;CODE&gt;head 250&lt;/CODE&gt; search?&lt;/P&gt;

&lt;P&gt;What you're saying here is likely related... but I do not understand how what you table affects what you are talking about&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 22:29:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501044#M139531</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2019-10-11T22:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501045#M139532</link>
      <description>&lt;P&gt;Can you explain the doubly tabled field more precisely? How does this look like?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Oct 2019 23:45:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501045#M139532</guid>
      <dc:creator>bojanjanisch</dc:creator>
      <dc:date>2019-10-11T23:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501046#M139533</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| table a b c d d e f g
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Oct 2019 23:59:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501046#M139533</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2019-10-11T23:59:32Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501047#M139534</link>
      <description>&lt;P&gt;Ah okay... so when you fixed this, your search returned results?&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2019 00:03:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501047#M139534</guid>
      <dc:creator>bojanjanisch</dc:creator>
      <dc:date>2019-10-12T00:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501048#M139535</link>
      <description>&lt;P&gt;Yep. It never broke the indexer though, and it didn't break a non-headed search&lt;/P&gt;</description>
      <pubDate>Sat, 12 Oct 2019 00:11:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501048#M139535</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2019-10-12T00:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501049#M139536</link>
      <description>&lt;P&gt;Try running your search with this at the end; is it still broken?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... |noop search_optimization=false
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 13 Oct 2019 00:43:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501049#M139536</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-10-13T00:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501050#M139537</link>
      <description>&lt;P&gt;We need to see the EXACT search.  I am suspicious of this claim.  Perhaps he forgot the &lt;CODE&gt;|&lt;/CODE&gt; before &lt;CODE&gt;head 250&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 13:27:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501050#M139537</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-05-22T13:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501051#M139538</link>
      <description>&lt;P&gt;Read the post. You shoudn't be suspicious of this claim. It's because tabling the same field twice in Splunk makes the world burn&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 20:06:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501051#M139538</guid>
      <dc:creator>nick405060</dc:creator>
      <dc:date>2020-05-22T20:06:32Z</dc:date>
    </item>
    <item>
      <title>Re: Bizarre bug with "head"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501052#M139539</link>
      <description>&lt;P&gt;I posted both searches, working and failing... I only changed the labels / field values, not the commands... If you wish to continue the research I can see if I can reproduce the bug... We simply avoid the non working version&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 21:18:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Bizarre-bug-with-quot-head-quot/m-p/501052#M139539</guid>
      <dc:creator>bojanjanisch</dc:creator>
      <dc:date>2020-05-22T21:18:58Z</dc:date>
    </item>
  </channel>
</rss>

