<?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: Help with stats values commands in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/When-using-stats-to-display-values-of-fields-how-can-we-have-the/m-p/628449#M218288</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229059"&gt;@neerajs_81&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;in values option, values are sorted in alphabetically way, so yu'll never had the correct alignment between&amp;nbsp; different fields, the only way is aggregate them before the stats command and separating them after, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| eval column=Status."|".Count
| stats values(column) AS column values(Status) AS Status BY Severity
| rex field=column "(?&amp;lt;Count&amp;gt;\d+)$"
| table Severity Status Count&lt;/LI-CODE&gt;&lt;P&gt;I cannot test it but it should run!&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2023 11:48:51 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-01-26T11:48:51Z</dc:date>
    <item>
      <title>When using stats to display values() of  fields, how can we have the values to align between the field names?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-using-stats-to-display-values-of-fields-how-can-we-have-the/m-p/628448#M218287</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp; When using stats&amp;nbsp; to display values() of&amp;nbsp; fields , how can we have the values to align between the field names ?&amp;nbsp;&amp;nbsp;For example&lt;BR /&gt;My Data set&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Severity&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Status&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Count&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;P1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;New&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;1&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;P1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Open&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;P1&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;Unassigned&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;P1&lt;/TD&gt;
&lt;TD&gt;Closed&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;When using&lt;STRONG&gt; | stats values(status) as status, values(Count) as Count by severity&lt;/STRONG&gt;&lt;BR /&gt;this is what i get.&amp;nbsp; Notice the count values are not as per dataset.&lt;/P&gt;
&lt;TABLE border="1" width="283px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="93.6094px" height="25px"&gt;Severity&lt;/TD&gt;
&lt;TD width="94.9844px" height="25px"&gt;Status&lt;/TD&gt;
&lt;TD width="93.4062px" height="25px"&gt;Count&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="93.6094px" height="25px"&gt;P1&lt;/TD&gt;
&lt;TD width="94.9844px" height="25px"&gt;New&lt;BR /&gt;Open&lt;BR /&gt;Unassigned&lt;BR /&gt;Closed&lt;/TD&gt;
&lt;TD width="93.4062px" height="25px"&gt;1&lt;BR /&gt;5&lt;BR /&gt;3&lt;BR /&gt;2&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;i did like the results of Count to align as per their Status field.&lt;BR /&gt;&lt;BR /&gt;Expected Result&lt;/P&gt;
&lt;TABLE border="1"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="93.6094px" height="25px"&gt;Severity&lt;/TD&gt;
&lt;TD width="94.9844px" height="25px"&gt;Status&lt;/TD&gt;
&lt;TD width="93.4062px" height="25px"&gt;Count&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="93.6094px" height="25px"&gt;P1&lt;/TD&gt;
&lt;TD width="94.9844px" height="25px"&gt;New&lt;BR /&gt;Open&lt;BR /&gt;Unassigned&lt;BR /&gt;Closed&lt;/TD&gt;
&lt;TD width="93.4062px" height="25px"&gt;1&lt;BR /&gt;2&lt;BR /&gt;3&lt;BR /&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;</description>
      <pubDate>Thu, 26 Jan 2023 19:20:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-using-stats-to-display-values-of-fields-how-can-we-have-the/m-p/628448#M218287</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2023-01-26T19:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Help with stats values commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-using-stats-to-display-values-of-fields-how-can-we-have-the/m-p/628449#M218288</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229059"&gt;@neerajs_81&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;in values option, values are sorted in alphabetically way, so yu'll never had the correct alignment between&amp;nbsp; different fields, the only way is aggregate them before the stats command and separating them after, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| eval column=Status."|".Count
| stats values(column) AS column values(Status) AS Status BY Severity
| rex field=column "(?&amp;lt;Count&amp;gt;\d+)$"
| table Severity Status Count&lt;/LI-CODE&gt;&lt;P&gt;I cannot test it but it should run!&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 11:48:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-using-stats-to-display-values-of-fields-how-can-we-have-the/m-p/628449#M218288</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-01-26T11:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Help with stats values commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-using-stats-to-display-values-of-fields-how-can-we-have-the/m-p/628455#M218290</link>
      <description>&lt;P&gt;That worked. Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 12:21:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-using-stats-to-display-values-of-fields-how-can-we-have-the/m-p/628455#M218290</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2023-01-26T12:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with stats values commands</title>
      <link>https://community.splunk.com/t5/Splunk-Search/When-using-stats-to-display-values-of-fields-how-can-we-have-the/m-p/628461#M218292</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229059"&gt;@neerajs_81&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 13:23:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/When-using-stats-to-display-values-of-fields-how-can-we-have-the/m-p/628461#M218292</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-01-26T13:23:18Z</dc:date>
    </item>
  </channel>
</rss>

