<?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: Determining the max value of a multivalue field containing comma delimited text and number in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521601#M146998</link>
    <description>&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,1;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,5" 
| eval test2="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| eval test3= "Linked to Historical Cyber Exploit,1;Historically Linked to Malware,4;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| eval test4="Linked to Historical Cyber Exploit,2;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,2" 
| table test* 
| transpose 
| table "row 1" 
| rename "row 1" as data 
| makemv delim=";" data
| streamstats count as row
| mvexpand data
| rex field=data ",(?&amp;lt;value&amp;gt;\d+)$"
| eventstats max(value) as largest by row
| where value=largest
| fields - largest value
| stats values(*) as * by row
| fields - row&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 26 Sep 2020 08:38:14 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2020-09-26T08:38:14Z</dc:date>
    <item>
      <title>Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521495#M146965</link>
      <description>&lt;P&gt;I have a comma delimited multivalue field that contains text and a digit in each value pair that I am trying to find the maximum digit and return the text and digit to the results.&amp;nbsp;&lt;/P&gt;&lt;P&gt;My multivalue field contains the following values:&lt;/P&gt;&lt;P&gt;Linked to Historical Cyber Exploit,1&lt;BR /&gt;Historically Linked to Malware,1&lt;BR /&gt;Historically Linked to Penetration Testing Tools,1&lt;BR /&gt;Exploited in the Wild by Recently Active Malware,5&lt;/P&gt;&lt;P&gt;If I just do a simple max(fieldName) it returns the following:&lt;/P&gt;&lt;P&gt;Linked to Historical Cyber Exploit,1&lt;/P&gt;&lt;P&gt;Which seems to be based off of the alphabetic interpretation of 'max'. What I want to return is:&lt;/P&gt;&lt;P&gt;Exploited in the Wild by Recently Active Malware,5&lt;/P&gt;&lt;P&gt;I think I need to do an mvexpand() followed by a rex of the resulting field but I am at a loss of how to return anything other than a "5" instead of the whole line.&lt;/P&gt;&lt;P&gt;Thanks in advance for any help!&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 15:40:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521495#M146965</guid>
      <dc:creator>mydog8it</dc:creator>
      <dc:date>2020-09-25T15:40:47Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521499#M146966</link>
      <description>&lt;P&gt;Can you split and create two new fields.&lt;/P&gt;&lt;P&gt;use eventstats to get max digit by text.&lt;/P&gt;&lt;P&gt;and then Where condition to match digit with max digit.&lt;/P&gt;&lt;P&gt;let me know if you have problem of using split and mvexpand.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 15:55:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521499#M146966</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-25T15:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521502#M146968</link>
      <description>&lt;LI-CODE lang="markup"&gt;| mvexpand yourfield
| rex field=yourfield ",(?&amp;lt;value&amp;gt;\d+)$"
| sort - value
| head 1&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 25 Sep 2020 16:02:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521502#M146968</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-25T16:02:53Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521543#M146981</link>
      <description>&lt;P&gt;I figured out a way to use makeresults to emulate my data, its ugly. If there is a better way to do it, I would love to hear that too!&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,1;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,5" 
| eval test2="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| eval test3= "Linked to Historical Cyber Exploit,1;Historically Linked to Malware,4;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| eval test4="Linked to Historical Cyber Exploit,2;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,2" 
| table test* 
| transpose 
| table "row 1" 
| rename "row 1" as data 
| makemv delim=";" data&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 25 Sep 2020 18:56:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521543#M146981</guid>
      <dc:creator>mydog8it</dc:creator>
      <dc:date>2020-09-25T18:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521544#M146982</link>
      <description>&lt;P&gt;This is only returning one result out of all my events. I added some SPL to emulate my data, can you take another look?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 18:58:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521544#M146982</guid>
      <dc:creator>mydog8it</dc:creator>
      <dc:date>2020-09-25T18:58:01Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521545#M146983</link>
      <description>&lt;P&gt;I tried to use this process but couldn't get it to work. I've added some SPL to emulate my data, can you give it another look?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 18:59:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521545#M146983</guid>
      <dc:creator>mydog8it</dc:creator>
      <dc:date>2020-09-25T18:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521560#M146987</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,1;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,5" 
| eval test2="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| eval test3= "Linked to Historical Cyber Exploit,1;Historically Linked to Malware,4;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| eval test4="Linked to Historical Cyber Exploit,2;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,2" 
| table test* 
| transpose 
| table "row 1" 
| rename "row 1" as data 
| makemv delim=";" data
| streamstats count as row
| mvexpand data
| rex field=data ",(?&amp;lt;value&amp;gt;\d+)$"
| eventstats max(value) as largest by row
| where value=largest
| fields - largest row value&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 25 Sep 2020 21:08:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521560#M146987</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-25T21:08:19Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521566#M146989</link>
      <description>&lt;P&gt;This returns the field values great, but as separate events. Do you know how to pull them back together as a mv field?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 22:35:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521566#M146989</guid>
      <dc:creator>mydog8it</dc:creator>
      <dc:date>2020-09-25T22:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521569#M146990</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,1;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,5" 
| eval test2="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| eval test3= "Linked to Historical Cyber Exploit,1;Historically Linked to Malware,4;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| eval test4="Linked to Historical Cyber Exploit,2;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,2" 
| table test* 
| transpose 
| table "row 1" 
| rename "row 1" as data 
| makemv delim=";" data
| streamstats count as row
| mvexpand data
| rex field=data ",(?&amp;lt;value&amp;gt;\d+)$"
| eventstats max(value) as largest by row
| where value=largest
| fields - largest value
| stats values(data) as data by row
| fields - row&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 25 Sep 2020 23:32:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521569#M146990</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-25T23:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521576#M146992</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=_internal | head 1 | fields _raw _time 
| eval test="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,1;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,5" 
| appendpipe [eval test="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| appendpipe [eval test= "Linked to Historical Cyber Exploit,1;Historically Linked to Malware,4;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| appendpipe [eval test="Linked to Historical Cyber Exploit,2;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,2" ]]]
| makemv delim=";" test
| mvexpand test
| rename test as _raw
| rename COMMENT as "this is sample. from here, the logic." 
| rex "(?&amp;lt;num&amp;gt;\d+$)"
| eventstats max(num) as max_num
| stats values(eval(if(like(_raw,"%".max_num),_raw,NULL))) as result&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 26 Sep 2020 01:15:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521576#M146992</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-09-26T01:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521580#M146993</link>
      <description>&lt;P&gt;I do not have the ability to search _indexes, so I adapted your solution to my makeresults method like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,1;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,5" 
| eval test2="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| eval test3= "Linked to Historical Cyber Exploit,1;Historically Linked to Malware,4;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| eval test4="Linked to Historical Cyber Exploit,2;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,2" 
| table test* 
| transpose 
| table "row 1" 
| rename "row 1" as data 
| makemv delim=";" data
| mvexpand data
| rename data as _raw
| rename COMMENT as "this is sample. from here, the logic." 
| rex "(?&amp;lt;num&amp;gt;\d+$)"
| eventstats max(num) as max_num
| stats values(eval(if(like(_raw,"%".max_num),_raw,NULL))) as result&lt;/LI-CODE&gt;&lt;P&gt;This solution identifies one field with the highest value, but does not return the value for each field. I should have updated my desired results, because my original description is incomplete. The results I would like to get from this dataset would look similar to this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mydog8it_0-1601087846541.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/10985i6E7AB1B690C8AD39/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mydog8it_0-1601087846541.png" alt="mydog8it_0-1601087846541.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The problem I am facing now is the proposed solutions to recreate the multivalue field use stats which drops the other fields in my data that I didn't include in the example.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 02:40:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521580#M146993</guid>
      <dc:creator>mydog8it</dc:creator>
      <dc:date>2020-09-26T02:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521581#M146994</link>
      <description>&lt;P&gt;This is great, except it is dropping the peripheral data in my real search due to the use of stats to recreate the multivalue field. Do you know how to recreate the field without the use of stats?&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 02:43:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521581#M146994</guid>
      <dc:creator>mydog8it</dc:creator>
      <dc:date>2020-09-26T02:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521587#M146995</link>
      <description>&lt;P&gt;If digit is same, what's displayed?&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 06:14:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521587#M146995</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-09-26T06:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521601#M146998</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,1;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,5" 
| eval test2="Linked to Historical Cyber Exploit,1;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| eval test3= "Linked to Historical Cyber Exploit,1;Historically Linked to Malware,4;Historically Linked to Penetration Testing Tools,1;Exploited in the Wild by Recently Active Malware,4" 
| eval test4="Linked to Historical Cyber Exploit,2;Historically Linked to Malware,2;Historically Linked to Penetration Testing Tools,2" 
| table test* 
| transpose 
| table "row 1" 
| rename "row 1" as data 
| makemv delim=";" data
| streamstats count as row
| mvexpand data
| rex field=data ",(?&amp;lt;value&amp;gt;\d+)$"
| eventstats max(value) as largest by row
| where value=largest
| fields - largest value
| stats values(*) as * by row
| fields - row&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 26 Sep 2020 08:38:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/521601#M146998</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-26T08:38:14Z</dc:date>
    </item>
    <item>
      <title>Re: Determining the max value of a multivalue field containing comma delimited text and number</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/612380#M212915</link>
      <description>&lt;P&gt;I had a similar issue where I needed to find the longest string in a multivalue, but I didn't want to mess with my results by using mvexpand and then gathering them back with a stats, because in some cases the multivalue could be empty. So I found this solution instead.&lt;/P&gt;&lt;P&gt;It's using the newish mvmap command to massage the multivalue and then the min/max statistical function that works with strings using alphabetical order. The use of printf ensures alphabetical and numerical order are the same.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval test=split("abc,defgh,a,asdfasdfasdfasdf,igasfasd", ",")
| eval test2=mvmap(test, printf("%05d", len(test) ) . " - " . test)
| eval shortest=min(test2), longest=max(test2)
| eval shortest=replace(shortest, "^\d+ - ", "" ), longest=replace(longest, "^\d+ - ", "" )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Sep 2022 09:45:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Determining-the-max-value-of-a-multivalue-field-containing-comma/m-p/612380#M212915</guid>
      <dc:creator>gabriel_vasseur</dc:creator>
      <dc:date>2022-09-08T09:45:33Z</dc:date>
    </item>
  </channel>
</rss>

