<?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: Why am I getting less fields returned from a search with the stats command compared to transaction? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239409#M71120</link>
    <description>&lt;P&gt;The comparison isn't immediately apples to apples. Depending on what you are trying to achieve the stats values command could get you the desired functionality but it also might not &lt;/P&gt;

&lt;P&gt;The transaction command combines events that share a common field into a single event. Single event is key because the transaction command is what we call a centralized streaming command. In essence, when you see the result the result run the command the results will still be visible under the events tab in Splunk. The options of the transactions command allow you to limit the events grouped together in a certain time span. It will also add an eventcount and duration field. The most important thing to remember is that the entire raw events are combined into a single event by just concatenating them&lt;BR /&gt;
For example: &lt;CODE&gt;some search|transactions src_ip&lt;/CODE&gt; all the different events with a single src_ip concatenated together.&lt;/P&gt;

&lt;P&gt;The stats values command is what is known as a transforming command. The result is no longer raw events that can be viewed on the events tabs but statistics that are viewed in a table on the statistics tab. This will just provide a multivalued table entry of a particular field. &lt;/P&gt;

&lt;P&gt;For example: &lt;CODE&gt;some search|stats values(src_ip)&lt;/CODE&gt; will give me a multivalue table entry of all the different source ips in the preceding data. &lt;/P&gt;

&lt;P&gt;The transaction command is a hungry command. So using it depends on your use case. If you seek functionality that is achievable by the stats values command definitely do that but if you really need the functionality of the transactions command then you will have to use it.&lt;/P&gt;

&lt;P&gt;References:&lt;BR /&gt;
[1] &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/Transaction"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/Transaction&lt;/A&gt;&lt;BR /&gt;
[2] &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/CommonStatsFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/CommonStatsFunctions&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 07 Jul 2016 13:44:44 GMT</pubDate>
    <dc:creator>craigv_splunk</dc:creator>
    <dc:date>2016-07-07T13:44:44Z</dc:date>
    <item>
      <title>Why am I getting less fields returned from a search with the stats command compared to transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239407#M71118</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;

&lt;P&gt;I've been told to use &lt;CODE&gt;stats values()&lt;/CODE&gt; instead of &lt;CODE&gt;transaction&lt;/CODE&gt; for performance issues. However, with long log files with many fields, there seems to be some limitations to the &lt;CODE&gt;stats&lt;/CODE&gt; command as I get fewer fields returned compared to using &lt;CODE&gt;transaction&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;Should I still be using the &lt;CODE&gt;stats&lt;/CODE&gt; command? How can I ensure all fields and values are included?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 08:50:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239407#M71118</guid>
      <dc:creator>Urias</dc:creator>
      <dc:date>2016-07-07T08:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting less fields returned from a search with the stats command compared to transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239408#M71119</link>
      <description>&lt;P&gt;Could you provide examples of each command and what's missing out of the stats?&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 12:52:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239408#M71119</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-07-07T12:52:34Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting less fields returned from a search with the stats command compared to transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239409#M71120</link>
      <description>&lt;P&gt;The comparison isn't immediately apples to apples. Depending on what you are trying to achieve the stats values command could get you the desired functionality but it also might not &lt;/P&gt;

&lt;P&gt;The transaction command combines events that share a common field into a single event. Single event is key because the transaction command is what we call a centralized streaming command. In essence, when you see the result the result run the command the results will still be visible under the events tab in Splunk. The options of the transactions command allow you to limit the events grouped together in a certain time span. It will also add an eventcount and duration field. The most important thing to remember is that the entire raw events are combined into a single event by just concatenating them&lt;BR /&gt;
For example: &lt;CODE&gt;some search|transactions src_ip&lt;/CODE&gt; all the different events with a single src_ip concatenated together.&lt;/P&gt;

&lt;P&gt;The stats values command is what is known as a transforming command. The result is no longer raw events that can be viewed on the events tabs but statistics that are viewed in a table on the statistics tab. This will just provide a multivalued table entry of a particular field. &lt;/P&gt;

&lt;P&gt;For example: &lt;CODE&gt;some search|stats values(src_ip)&lt;/CODE&gt; will give me a multivalue table entry of all the different source ips in the preceding data. &lt;/P&gt;

&lt;P&gt;The transaction command is a hungry command. So using it depends on your use case. If you seek functionality that is achievable by the stats values command definitely do that but if you really need the functionality of the transactions command then you will have to use it.&lt;/P&gt;

&lt;P&gt;References:&lt;BR /&gt;
[1] &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/Transaction"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/Transaction&lt;/A&gt;&lt;BR /&gt;
[2] &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/CommonStatsFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.1/SearchReference/CommonStatsFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 13:44:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239409#M71120</guid>
      <dc:creator>craigv_splunk</dc:creator>
      <dc:date>2016-07-07T13:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting less fields returned from a search with the stats command compared to transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239410#M71121</link>
      <description>&lt;P&gt;It's interesting that you make the comparison between &lt;CODE&gt;stats values()&lt;/CODE&gt; and &lt;CODE&gt;transaction&lt;/CODE&gt; as they were designed to do completely different things. It would be nice to understand the use case.&lt;/P&gt;

&lt;P&gt;A similar case at &lt;A href="https://answers.splunk.com/answers/27794/transactions-stats.html"&gt;Transactions/Stats?&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;It was suggested there to use the &lt;CODE&gt;map&lt;/CODE&gt; command to delineate the beginning and end of the transaction - a cheerful idea.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jul 2016 13:49:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239410#M71121</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-07-07T13:49:36Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting less fields returned from a search with the stats command compared to transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239411#M71122</link>
      <description>&lt;P&gt;I have multiple log files with multiple events (with multiple fields) for a session which I'd like to display for a given session. Put simply, I can then do either:&lt;BR /&gt;
 1. &lt;CODE&gt;search sessionID=1234 | stats values(*) as * by sessionID | table * | transpose&lt;/CODE&gt;&lt;BR /&gt;
 2. &lt;CODE&gt;search sessionID=1234 | transaction sessionID | table * | transpose&lt;/CODE&gt;&lt;BR /&gt;
The goal is to list all fields and values for easy inspection. With the first search I hit some limitation in log lines with many fields. This does not occur in the second search.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 11:35:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239411#M71122</guid>
      <dc:creator>Urias</dc:creator>
      <dc:date>2016-07-08T11:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting less fields returned from a search with the stats command compared to transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239412#M71123</link>
      <description>&lt;P&gt;Thanks. I probably want the "transaction" command, I assume. Although it is not always obvious to me what is the right choice. (See comment to the question for details)&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 11:40:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239412#M71123</guid>
      <dc:creator>Urias</dc:creator>
      <dc:date>2016-07-08T11:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting less fields returned from a search with the stats command compared to transaction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239413#M71124</link>
      <description>&lt;P&gt;Great, thanks for the nice explanation! It does not always seem obvious which choice is best here...&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jul 2016 11:41:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-less-fields-returned-from-a-search-with-the/m-p/239413#M71124</guid>
      <dc:creator>Urias</dc:creator>
      <dc:date>2016-07-08T11:41:43Z</dc:date>
    </item>
  </channel>
</rss>

