<?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 strings based on number character in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-sort-strings-based-on-number-character/m-p/596244#M48890</link>
    <description>&lt;P&gt;Can you not just sort by SEQUENCE?&lt;/P&gt;</description>
    <pubDate>Tue, 03 May 2022 11:53:17 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-05-03T11:53:17Z</dc:date>
    <item>
      <title>How to sort strings based on number character?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-sort-strings-based-on-number-character/m-p/596240#M48889</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a field which is a concatenation of a URL and a Sequence number, e.g. /google.ie:23 or /ebay.com:43.&lt;BR /&gt;&lt;BR /&gt;I need to order this string field in descending order base based on the string number at the end of the field and then create 2 fields "To" and "From" showing:&lt;BR /&gt;&lt;BR /&gt;To&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; From&lt;BR /&gt;/yahoo.ie:1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/google.ie:2&lt;BR /&gt;/google.ie:2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;/facebook.ie:3&lt;BR /&gt;.............................&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;At the moment, I am able to do the concatenation, but I am unable to sort on the numbers or create the required "To" or "From" fields:&lt;BR /&gt;index = .....&lt;BR /&gt;| eval time_epoch = strptime('SESSION_TIMESTAMP', "%Y-%m-%d %H:%M:%S")&lt;BR /&gt;| convert ctime(time_epoch) as hour_minute timeformat="%Y-%m-%d %H:%M"&lt;BR /&gt;| strcat URL_PATH ":" SEQUENCE combo_time&lt;BR /&gt;| table combo_time&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Can you please help?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Many thanks,&lt;BR /&gt;P&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 16:11:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-sort-strings-based-on-number-character/m-p/596240#M48889</guid>
      <dc:creator>POR160893</dc:creator>
      <dc:date>2022-05-03T16:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sort strings based on number character</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-sort-strings-based-on-number-character/m-p/596244#M48890</link>
      <description>&lt;P&gt;Can you not just sort by SEQUENCE?&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 11:53:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-sort-strings-based-on-number-character/m-p/596244#M48890</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-05-03T11:53:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sort strings based on number character</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-sort-strings-based-on-number-character/m-p/596245#M48891</link>
      <description>&lt;P&gt;Hey,&lt;BR /&gt;&lt;BR /&gt;Yes, I sorted on SEQUENCE. This is where I am currently at:&lt;BR /&gt;&lt;BR /&gt;......&lt;BR /&gt;| eval time_epoch = strptime('SESSION_TIMESTAMP', "%Y-%m-%d %H:%M:%S")&lt;BR /&gt;| convert ctime(time_epoch) as hour_minute timeformat="%Y-%m-%d %H:%M"&lt;BR /&gt;| strcat URL_PATH ":" SEQUENCE combo_time&lt;BR /&gt;| table combo_time, SEQUENCE&lt;BR /&gt;| eval temp = tonumber(SEQUENCE)&lt;BR /&gt;| sort temp&lt;BR /&gt;| rename combo_time as from&lt;BR /&gt;| eval to = from&lt;BR /&gt;| table from,to&lt;BR /&gt;&lt;BR /&gt;The output is as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;For the "to" field, I need to remove the first&amp;nbsp; number and replace it with the 2nd, and continue doing this until "from" has its last number and "to" has nothing, like this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;from&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; to&lt;BR /&gt;....:1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;......:2&lt;BR /&gt;.....2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.......:3&lt;BR /&gt;.....:3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .......:4&lt;BR /&gt;&lt;BR /&gt;........................................&lt;BR /&gt;.........N&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;BLANK&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;How can I do this?????&lt;BR /&gt;&lt;BR /&gt;(I gave you Karma for your last message though&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 12:27:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-sort-strings-based-on-number-character/m-p/596245#M48891</guid>
      <dc:creator>POR160893</dc:creator>
      <dc:date>2022-05-03T12:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Sort strings based on number character</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-sort-strings-based-on-number-character/m-p/596268#M48893</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hey,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I sorted on SEQUENCE. This is where I am currently at:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;......&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| eval time_epoch = strptime('SESSION_TIMESTAMP', "%Y-%m-%d %H:%M:%S")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| convert ctime(time_epoch) as hour_minute timeformat="%Y-%m-%d %H:%M"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| strcat URL_PATH ":" SEQUENCE combo_time&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| table combo_time, SEQUENCE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| eval temp = tonumber(SEQUENCE)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| sort temp&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| rename combo_time as from&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| eval to = from&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| table from,to&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The output is as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For the "to" field, I need to remove the first&amp;nbsp; number and replace it with the 2nd, and continue doing this until "from" has its last number and "to" has nothing, like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;from&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; to&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;....:1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;......:2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.....2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.......:3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.....:3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .......:4&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;........................................&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.........N&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;BLANK&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How can I do this?????&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 14:36:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-sort-strings-based-on-number-character/m-p/596268#M48893</guid>
      <dc:creator>POR160893</dc:creator>
      <dc:date>2022-05-03T14:36:56Z</dc:date>
    </item>
  </channel>
</rss>

