<?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: Splunk 7.2.3: Alternative or solution to table command bug in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396320#M115066</link>
    <description>&lt;P&gt;I am using version 7.2.6. Repeating fields in table command does not cause any errors, but the output does no repeat the fields in the header.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table a, b, b, c, d, d, b 
a, b, c, d (header)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I guess that It would be better to not repeat fields in this command, since It will not produce any different results in your output.&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2019 17:00:11 GMT</pubDate>
    <dc:creator>alonsocaio</dc:creator>
    <dc:date>2019-06-03T17:00:11Z</dc:date>
    <item>
      <title>Splunk 7.2.3: Alternative or solution to table command bug</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396318#M115064</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;

&lt;P&gt;Has anyone else run into this bug with the  &lt;CODE&gt;table&lt;/CODE&gt; command on Splunk 7.2.3?  The  &lt;CODE&gt;table&lt;/CODE&gt; command works just fine unless you mistakenly list a field twice otherwise you have strange and unexpected results. &lt;BR /&gt;
For me, the issue doesn't happen on Splunk 7.2.5+, but I was wondering if there was a workaround other than upgrading. &lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Data as expected&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table A B C D
A,B,C,D (header)
a,b,c,d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;EM&gt;Using the table command repeating a field usually has no results IF there are few fields&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table A B A D
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;... no Results ...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table B B A
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;... no Results ...&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;Using the table command incorrectly with more tables tends to eschew results to the right&lt;/EM&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table A B B C D E C F
A B C D E F (header)
a,b,b,b,c,c
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 May 2019 16:42:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396318#M115064</guid>
      <dc:creator>_joe</dc:creator>
      <dc:date>2019-05-31T16:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2.3: Alternative or solution to table command bug</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396319#M115065</link>
      <description>&lt;P&gt;I think the workaround/fix is to not repeat fields in the &lt;CODE&gt;table&lt;/CODE&gt; command.&lt;/P&gt;</description>
      <pubDate>Fri, 31 May 2019 17:00:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396319#M115065</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-05-31T17:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2.3: Alternative or solution to table command bug</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396320#M115066</link>
      <description>&lt;P&gt;I am using version 7.2.6. Repeating fields in table command does not cause any errors, but the output does no repeat the fields in the header.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| table a, b, b, c, d, d, b 
a, b, c, d (header)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I guess that It would be better to not repeat fields in this command, since It will not produce any different results in your output.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2019 17:00:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396320#M115066</guid>
      <dc:creator>alonsocaio</dc:creator>
      <dc:date>2019-06-03T17:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2.3: Alternative or solution to table command bug</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396321#M115067</link>
      <description>&lt;P&gt;Use fields instead of table.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 16:06:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396321#M115067</guid>
      <dc:creator>codebuilder</dc:creator>
      <dc:date>2019-06-05T16:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2.3: Alternative or solution to table command bug</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396322#M115068</link>
      <description>&lt;P&gt;Hi @_joe ,&lt;/P&gt;

&lt;P&gt;Did you have a chance to check out any answers? If it worked, please resolve this post by approving it! If your problem is still not solved, keep us updated so that someone else can help you. &lt;/P&gt;

&lt;P&gt;Thanks for posting!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2019 22:02:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396322#M115068</guid>
      <dc:creator>evania</dc:creator>
      <dc:date>2019-06-17T22:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2.3: Alternative or solution to table command bug</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396323#M115069</link>
      <description>&lt;P&gt;I wanted to provide the general feedback to everyone that this is related to bug SPL-163831. I was hoping to find an answer other than upgrading so I opened a ticket with Splunk but they were unable to provide a work around. &lt;/P&gt;

&lt;P&gt;If you cannot upgrade, obviously your best bet is to educate users to make sure they do not mistakenly list a field twice while using the |head command. In my personal opinion this is still rather devastating because it impacts your user's confidence in the Splunk, especially if they are already using another product. &lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 16:44:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396323#M115069</guid>
      <dc:creator>_joe</dc:creator>
      <dc:date>2019-06-18T16:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2.3: Alternative or solution to table command bug</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396324#M115070</link>
      <description>&lt;P&gt;@alonsocaio  thanks for the feedback. To clear, my concern is uses doing this on accident and then receiving incorrect results. &lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 16:46:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396324#M115070</guid>
      <dc:creator>_joe</dc:creator>
      <dc:date>2019-06-18T16:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2.3: Alternative or solution to table command bug</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396325#M115071</link>
      <description>&lt;P&gt;Generally these bugs are caused by errors in the search optimizer code.  This code can be disabled on a search-by-search basis by adding this string to the VERY END of your search SPL string:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | noop search_optimization=false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alternatively, if you add this to the end, it will add debug to the search.log in the job inspector (don't use on 7.1.0-7.1.6 as it can cause search to crash):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | noop log_DEBUG=*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For more, see here:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Noop"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Noop&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jun 2019 16:54:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396325#M115071</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-06-18T16:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2.3: Alternative or solution to table command bug</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396326#M115072</link>
      <description>&lt;P&gt;Thanks for your comment. Unfortunately this did NOT work for me on 7.2.3. Personally, I am believing that there is no reliable work around for this (other than to upgrade or educate your users to make sure they don't accidentally add a field twice). &lt;/P&gt;

&lt;P&gt;Example:&lt;BR /&gt;
| stats count by host, sourcetype, _time, index&lt;BR /&gt;
| table _time host, sourcetype _time index&lt;BR /&gt;
| noop search_optimization=false&lt;/P&gt;

&lt;P&gt;Basically the results show the index field is populated with epoch time values&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 01:04:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396326#M115072</guid>
      <dc:creator>_joe</dc:creator>
      <dc:date>2020-09-30T01:04:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk 7.2.3: Alternative or solution to table command bug</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396327#M115073</link>
      <description>&lt;P&gt;You can use this search to alert you whenever anybody is using &lt;CODE&gt;table&lt;/CODE&gt; with a duplicated argument:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_* sourcetype="audittrail"
| rex "(?ms)search='(?&amp;lt;search&amp;gt;.*)$"
| rex field=search mode=sed "s/', autojoin='1',.*$//"
| rex max_match=0 "(?msi)\|\s*table\s+(?&amp;lt;table_arguments&amp;gt;[^\|]+)($|\S)"
| search table_arguments="*"
| rex field=table_arguments mode=sed "s/', autojoin='1',.*$//"
| table _raw user search table_arguments
| mvexpand table_arguments
| rex field=table_arguments max_match=0 "(?J)\"(?&amp;lt;fieldname1&amp;gt;[^\"]+)\"|(?&amp;lt;fieldname2&amp;gt;\S+)"
| eval fieldnames = mvappend(fieldname1, fieldname2)
| fields - fieldname1 fieldname2
| rex field=fieldnames mode=sed "s/,$//"
| streamstats count AS serial
| eventstats count(fieldnames) AS count_total dc(fieldnames) AS count_distinct BY serial
| where count_distinct &amp;lt; count_total
| eventstats list(fieldnames) AS values_total values(fieldnames) AS values_distinct BY serial
| eval values_total = mvsort(values_total)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Jun 2019 05:05:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-7-2-3-Alternative-or-solution-to-table-command-bug/m-p/396327#M115073</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-06-28T05:05:07Z</dc:date>
    </item>
  </channel>
</rss>

