<?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: Sort eval-ed field by one of its parent fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620084#M215537</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/92859"&gt;@Dworsnop&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats count(ID) AS countID by severity, name
| eval name_count=name." (".countID.")"
| stats values(name_count) AS Signatures count by severity
| rex field=Signatures "\((?&amp;lt;countID&amp;gt;\d+)"
| sort severity -countID
| fields - countID&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2022 11:03:27 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2022-11-08T11:03:27Z</dc:date>
    <item>
      <title>Is  there a way to sort eval-ed field by one of its parent fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620081#M215535</link>
      <description>&lt;P&gt;Hi all, I need some help sorting an eval field by one of it's components per below.&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| eventstats count(ID) AS countID by severity, name
| eval name_count=name." (".countID.")"
| stats values(name_count) AS Signatures count by severity

&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This gives me something like...&lt;/P&gt;
&lt;P&gt;severity&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Signatures&lt;BR /&gt;Critical&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; asig0 (34)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bsig1 (2)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;csig2 (76)&lt;BR /&gt;High&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;asig3 (1)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bsig4 (23)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; csig5 (22)&lt;/P&gt;
&lt;P&gt;What I want...&lt;/P&gt;
&lt;P&gt;severity&amp;nbsp; &amp;nbsp; &amp;nbsp; Signatures&lt;BR /&gt;Critical&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; csig2 (76)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;asig0 (34)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;bsig1 (2)&lt;BR /&gt;High&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; bsig4 (23)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;csig5 (22)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;asig3 (1)&lt;/P&gt;
&lt;P&gt;Is there any way I can sort the Signatures column by the values in the countID field?&lt;/P&gt;
&lt;P&gt;Thanks in advance! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 16:55:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620081#M215535</guid>
      <dc:creator>Dworsnop</dc:creator>
      <dc:date>2022-11-08T16:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sort eval-ed field by one of its parent fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620084#M215537</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/92859"&gt;@Dworsnop&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats count(ID) AS countID by severity, name
| eval name_count=name." (".countID.")"
| stats values(name_count) AS Signatures count by severity
| rex field=Signatures "\((?&amp;lt;countID&amp;gt;\d+)"
| sort severity -countID
| fields - countID&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 11:03:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620084#M215537</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-08T11:03:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sort eval-ed field by one of its parent fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620104#M215551</link>
      <description>&lt;P&gt;Thanks for the pointers &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt; . I've used what you've provided and I can extract the 'countID' value but when I try to sort by it all it does is sort the severity column and doesn't appear to do anything with the Signatures one.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 13:06:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620104#M215551</guid>
      <dc:creator>Dworsnop</dc:creator>
      <dc:date>2022-11-08T13:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sort eval-ed field by one of its parent fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620117#M215560</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/92859"&gt;@Dworsnop&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;did you tried to sort by severity and countID desc, as I hinted?&lt;/P&gt;&lt;P&gt;could you share your search and the result you have?&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 14:04:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620117#M215560</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-08T14:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Sort eval-ed field by one of its parent fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620158#M215574</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;, here's my full search...&lt;/P&gt;&lt;P&gt;... severity IN ("Critical", "High", "Medium")&lt;BR /&gt;| eventstats count(ID) AS countID by severity, Name&lt;BR /&gt;| eval name_count=Name." (".countID.")"&lt;BR /&gt;| stats values(name_count) AS Signatures by severity&lt;BR /&gt;| rex field=Signatures "\((?&amp;lt;countID&amp;gt;\d+)\)$"&lt;BR /&gt;| sort severity, -countID&lt;BR /&gt;| fields - countID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately, due to the nature of the information, I can't share the results but I can tell you that the order of the Signatures column hasn't changed. I've even kept the countID column in and the numbers aren't sorted. I've tried "| sort severity, -num(countID)" as well but it does nothing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 16:40:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620158#M215574</guid>
      <dc:creator>Dworsnop</dc:creator>
      <dc:date>2022-11-08T16:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sort eval-ed field by one of its parent fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620230#M215597</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/92859"&gt;@Dworsnop&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;it isn't possible to have the exact solution that you would,&lt;/P&gt;&lt;P&gt;as a workaround you could have the severity vaue repeated in each row:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... severity IN ("Critical", "High", "Medium")
| eventstats count(ID) AS countID by severity, Name
| eval name_count=Name." (".countID.")"
| stats values(name_count) AS Signatures by severity
| mvexpand Signatures
| rex field=Signatures "\((?&amp;lt;countID&amp;gt;\d+)\)$"
| sort severity, -countID
| fields - countID&lt;/LI-CODE&gt;&lt;P&gt;or changing the order in the Signature field:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;... severity IN ("Critical", "High", "Medium")
| eventstats count(ID) AS countID by severity, Name
| eval name_count="(".countID.") ".Name
| stats values(name_count) AS Signatures by severity
| rex field=Signatures "^(?&amp;lt;countID&amp;gt;\d+)"
| sort severity, -countID
| fields - countID&lt;/LI-CODE&gt;&lt;P&gt;but in this case it's literaly ordinated, so 100 comes before 20.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 07:39:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620230#M215597</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-09T07:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Sort eval-ed field by one of its parent fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620245#M215605</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;Thanks very much for the help, in the end I went with...&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;... severity="Critical"&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;|&amp;nbsp;eventstats&amp;nbsp;count(ID) AS&amp;nbsp;countID&amp;nbsp;by severity, Name&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| eval&amp;nbsp;name_count=Name." (".countID.")"&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| rex field=name_count&amp;nbsp;"\((?&amp;lt;newcountID&amp;gt;\d+)\)$"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| stats count by&amp;nbsp;name_count,&amp;nbsp;newcountID&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| sort –&amp;nbsp;newcountID&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| fields -&amp;nbsp;newcountID, count&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;| rename&amp;nbsp;name_count&amp;nbsp;AS "Signatures (count)"&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 10:35:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620245#M215605</guid>
      <dc:creator>Dworsnop</dc:creator>
      <dc:date>2022-11-09T10:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sort eval-ed field by one of its parent fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620246#M215606</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/92859"&gt;@Dworsnop&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;ok good for you, only one detail: if you filter by severity, you don't need severity as key in the stats command.&lt;/P&gt;&lt;P&gt;Anyway, if one answer solves your need, please accept one answer for the other people of Community or tell me how I can help you.&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;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 10:50:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620246#M215606</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-09T10:50:27Z</dc:date>
    </item>
    <item>
      <title>Re: Sort eval-ed field by one of its parent fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620253#M215610</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/92859"&gt;@Dworsnop&lt;/a&gt;,&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>Wed, 09 Nov 2022 11:40:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-sort-eval-ed-field-by-one-of-its-parent-fields/m-p/620253#M215610</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-09T11:40:10Z</dc:date>
    </item>
  </channel>
</rss>

