<?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: split specific values from list in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/split-specific-values-from-list/m-p/486221#M136044</link>
    <description>&lt;P&gt;Here is my attempt:   &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval formatted_test_data="|&amp;lt;host1&amp;gt;C:,D: 500 GB,450 GB|&amp;lt;host2&amp;gt;E:,D: 250 GB,150 GB|&amp;lt;host3&amp;gt;C:,E: 250 GB,1 TB|&amp;lt;host4&amp;gt;S:,D:,C:,G: 120 GB,450 GB,250 GB,800 GB|"
| rex field=formatted_test_data "\|(?&amp;lt;test_data&amp;gt;[^\|]+)" max_match=0
| table _time test_data
| mvexpand test_data
| rex field=test_data "&amp;lt;(?&amp;lt;host&amp;gt;\w+)&amp;gt;"

| rex field=test_data "(?&amp;lt;drive&amp;gt;\w\:)" max_match=0
| rex field=test_data "(?&amp;lt;capacity&amp;gt;\d+\s[MGTP]B)" max_match=0
| eval drive_plus_capacity=mvzip(drive, capacity)
| fields - test_data capacity drive
| mvexpand drive_plus_capacity
| rex field=drive_plus_capacity "(?&amp;lt;drive&amp;gt;\w\:)\,(?&amp;lt;freespace&amp;gt;\d+\s[MGTP]B)"
| sort hostname drive
| streamstats count as drivenum by hostname reset_on_change=true
| chart list(drive_plus_capacity) over  hostname by drivenum
| rex field=1 "(?&amp;lt;drive1&amp;gt;\w\:)\,(?&amp;lt;freespace1&amp;gt;\d+\s[MGTP]B)"
| rex field=2 "(?&amp;lt;drive2&amp;gt;\w\:)\,(?&amp;lt;freespace2&amp;gt;\d+\s[MGTP]B)"
| rex field=3 "(?&amp;lt;drive3&amp;gt;\w\:)\,(?&amp;lt;freespace3&amp;gt;\d+\s[MGTP]B)"
| rex field=4 "(?&amp;lt;drive4&amp;gt;\w\:)\,(?&amp;lt;freespace4&amp;gt;\d+\s[MGTP]B)"
| fields - 1 2 3 4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;./DF&lt;/P&gt;</description>
    <pubDate>Thu, 05 Mar 2020 15:25:30 GMT</pubDate>
    <dc:creator>darrenfuller</dc:creator>
    <dc:date>2020-03-05T15:25:30Z</dc:date>
    <item>
      <title>split specific values from list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/split-specific-values-from-list/m-p/486219#M136042</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have data like below&lt;/P&gt;

&lt;P&gt;Drive          Free_Space&lt;/P&gt;

&lt;P&gt;C:,D:               500 GB,450 GB&lt;BR /&gt;
E:,D:                250 GB,150 GB&lt;BR /&gt;
C:,E:                250 GB,1 TB&lt;BR /&gt;
S:,D:,C:,G       120 GB,450 GB,250 GB,800 GB&lt;/P&gt;

&lt;P&gt;I want output as &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="outputimage"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8487iD461F3A61E711ADC/image-size/large?v=v2&amp;amp;px=999" role="button" title="outputimage" alt="outputimage" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Please help me for this urgent&lt;BR /&gt;
Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 11:49:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/split-specific-values-from-list/m-p/486219#M136042</guid>
      <dc:creator>harishalipaka</dc:creator>
      <dc:date>2020-03-05T11:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: split specific values from list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/split-specific-values-from-list/m-p/486220#M136043</link>
      <description>&lt;P&gt;Hi Harish,&lt;/P&gt;

&lt;P&gt;try this and if you like please accept and vote my answer&lt;/P&gt;

&lt;P&gt;| makemv delim="," Drive| makemv delim="," Free_Space| table Drive Free_Space | eval findC=mvfind(Drive,"C:")| eval findD=mvfind(Drive,"D:")|eval Drive1=mvindex(Drive,findC)|eval Drive2=mvindex(Drive,findD) |eval FreeSpace1=mvindex(Free_Space,findC)|eval FreeSpace2=mvindex(Free_Space,findD)&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:29:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/split-specific-values-from-list/m-p/486220#M136043</guid>
      <dc:creator>ajayabburi508</dc:creator>
      <dc:date>2020-09-30T04:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: split specific values from list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/split-specific-values-from-list/m-p/486221#M136044</link>
      <description>&lt;P&gt;Here is my attempt:   &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval formatted_test_data="|&amp;lt;host1&amp;gt;C:,D: 500 GB,450 GB|&amp;lt;host2&amp;gt;E:,D: 250 GB,150 GB|&amp;lt;host3&amp;gt;C:,E: 250 GB,1 TB|&amp;lt;host4&amp;gt;S:,D:,C:,G: 120 GB,450 GB,250 GB,800 GB|"
| rex field=formatted_test_data "\|(?&amp;lt;test_data&amp;gt;[^\|]+)" max_match=0
| table _time test_data
| mvexpand test_data
| rex field=test_data "&amp;lt;(?&amp;lt;host&amp;gt;\w+)&amp;gt;"

| rex field=test_data "(?&amp;lt;drive&amp;gt;\w\:)" max_match=0
| rex field=test_data "(?&amp;lt;capacity&amp;gt;\d+\s[MGTP]B)" max_match=0
| eval drive_plus_capacity=mvzip(drive, capacity)
| fields - test_data capacity drive
| mvexpand drive_plus_capacity
| rex field=drive_plus_capacity "(?&amp;lt;drive&amp;gt;\w\:)\,(?&amp;lt;freespace&amp;gt;\d+\s[MGTP]B)"
| sort hostname drive
| streamstats count as drivenum by hostname reset_on_change=true
| chart list(drive_plus_capacity) over  hostname by drivenum
| rex field=1 "(?&amp;lt;drive1&amp;gt;\w\:)\,(?&amp;lt;freespace1&amp;gt;\d+\s[MGTP]B)"
| rex field=2 "(?&amp;lt;drive2&amp;gt;\w\:)\,(?&amp;lt;freespace2&amp;gt;\d+\s[MGTP]B)"
| rex field=3 "(?&amp;lt;drive3&amp;gt;\w\:)\,(?&amp;lt;freespace3&amp;gt;\d+\s[MGTP]B)"
| rex field=4 "(?&amp;lt;drive4&amp;gt;\w\:)\,(?&amp;lt;freespace4&amp;gt;\d+\s[MGTP]B)"
| fields - 1 2 3 4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;./DF&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2020 15:25:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/split-specific-values-from-list/m-p/486221#M136044</guid>
      <dc:creator>darrenfuller</dc:creator>
      <dc:date>2020-03-05T15:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: split specific values from list</title>
      <link>https://community.splunk.com/t5/Splunk-Search/split-specific-values-from-list/m-p/486222#M136045</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214394"&gt;@harishalipaka&lt;/a&gt;,&lt;/P&gt;

&lt;P&gt;Try this query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makemv delim="," Drive 
| makemv delim="," Free_Space 
| eval fields = mvzip(Drive,Free_Space) 
| rex field=fields "(?&amp;lt;Drive1&amp;gt;[C]+):,(?&amp;lt;Free_Space1&amp;gt;[\d]+\sGB)" 
| rex field=fields "(?&amp;lt;Drive2&amp;gt;[D]+):,(?&amp;lt;Free_Space2&amp;gt;[\d]+\sGB)" 
| table Drive1, Drive2, Free_Space1, Free_Space2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Sample query:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;| makeresults &lt;BR /&gt;
| eval _raw="Drive Free_Space&lt;BR /&gt;
C:,D: 500 GB,450 GB&lt;BR /&gt;
E:,D: 250 GB,150 GB&lt;BR /&gt;
C:,E: 250 GB,1 TB&lt;BR /&gt;
S:,D:,C:,G 120 GB,450 GB,250 GB,800 GB" &lt;BR /&gt;
| multikv forceheader=1 &lt;BR /&gt;
| makemv delim="," Drive &lt;BR /&gt;
| makemv delim="," Free_Space &lt;BR /&gt;
| eval fields = mvzip(Drive,Free_Space) &lt;BR /&gt;
| rex field=fields "(?[C]+):,(?[\d]+\sGB)" &lt;BR /&gt;
| rex field=fields "(?[D]+):,(?[\d]+\sGB)" &lt;BR /&gt;
| table Drive1, Drive2, Free_Space1, Free_Space2&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:30:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/split-specific-values-from-list/m-p/486222#M136045</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-09-30T04:30:05Z</dc:date>
    </item>
  </channel>
</rss>

