<?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: How to split a field value and create multiple new fields at search-time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115257#M30509</link>
    <description>&lt;P&gt;Do you want their fileds named sequentially like drive1, drive2, drive3, etc., or something like driveC, driveD, driveE, etc.?&lt;/P&gt;</description>
    <pubDate>Wed, 25 Mar 2015 14:42:30 GMT</pubDate>
    <dc:creator>cpetterborg</dc:creator>
    <dc:date>2015-03-25T14:42:30Z</dc:date>
    <item>
      <title>How to split a field value and create multiple new fields at search-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115256#M30508</link>
      <description>&lt;P&gt;I have a search which returns drive usage of Windows servers. The information comes up like below in the field:&lt;/P&gt;

&lt;P&gt;C: 50.15 &lt;span class="lia-unicode-emoji" title=":anguished_face:"&gt;😧&lt;/span&gt; 2.57&lt;BR /&gt;
C: 32.32 E: 0.74 F: 0.72 G: 0.74 I: 0.72&lt;BR /&gt;
C: 45.06 F: 0.77 G: 1.05&lt;/P&gt;

&lt;P&gt;I want to split that into individual fields like below,&lt;/P&gt;

&lt;P&gt;C:50&lt;BR /&gt;
D:2.57&lt;/P&gt;

&lt;P&gt;I am not able to figure out how to use eval to split this into multiple new fields. Can someone help me with this?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 14:40:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115256#M30508</guid>
      <dc:creator>anoopambli</dc:creator>
      <dc:date>2015-03-25T14:40:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field value and create multiple new fields at search-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115257#M30509</link>
      <description>&lt;P&gt;Do you want their fileds named sequentially like drive1, drive2, drive3, etc., or something like driveC, driveD, driveE, etc.?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 14:42:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115257#M30509</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2015-03-25T14:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field value and create multiple new fields at search-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115258#M30510</link>
      <description>&lt;P&gt;C, D, E..etc&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 14:45:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115258#M30510</guid>
      <dc:creator>anoopambli</dc:creator>
      <dc:date>2015-03-25T14:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field value and create multiple new fields at search-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115259#M30511</link>
      <description>&lt;P&gt;I'm not sure of your reply about naming the fields, so here goes with the easiest (drive1, etc.):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | rex field=_raw "(?P&amp;lt;drive1&amp;gt;[C-Z]:\s\d+\.\d+)(\s+(?P&amp;lt;drive2&amp;gt;[C-Z]:\s\d+.\d+))?(\s+(?P&amp;lt;drive3&amp;gt;[C-Z]:\s\d+.\d+))?(\s+(?P&amp;lt;drive4&amp;gt;[C-Z]:\s\d+.\d+))?(\s+(?P&amp;lt;drive5&amp;gt;[C-Z]:\s\d+.\d+))?"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This assumes that there is nothing else in the event. If you have the data in a single field, then you can substitute that field name for _raw in the above &lt;CODE&gt;rex&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;If you do want the fields named something else, please describe exactly what you want and I can provide an update to this answer.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 15:02:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115259#M30511</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2015-03-25T15:02:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field value and create multiple new fields at search-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115260#M30512</link>
      <description>&lt;P&gt;I decided to provide the driveC, driveD, etc. method as well. You will have to add to it as needed for additional drives. It also assumes that they will be listed in alphabetical order:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | rex field=_raw "(C:\s(?P&amp;lt;driveC&amp;gt;\d+\.\d+))?(\s+D:\s(?P&amp;lt;driveD&amp;gt;\d+.\d+))?(\s+E:\s(?P&amp;lt;driveE&amp;gt;\d+.\d+))?(\s+F:\s(?P&amp;lt;driveF&amp;gt;\d+.\d+))?(\s+G:\s(?P&amp;lt;driveG&amp;gt;\d+.\d+))?(\s+H:\s(?P&amp;lt;driveH&amp;gt;\d+.\d+))?(\s+I:\s(?P&amp;lt;driveI&amp;gt;\d+.\d+))?(\s+J:\s(?P&amp;lt;driveJ&amp;gt;\d+.\d+))?(\s+K:\s(?P&amp;lt;driveK&amp;gt;\d+.\d+))?(\s+L:\s(?P&amp;lt;driveL&amp;gt;\d+.\d+))?(\s+M:\s(?P&amp;lt;driveM&amp;gt;\d+.\d+))?"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If they are not to be in alphabetical order, the it will take a bit more to do.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 15:12:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115260#M30512</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2015-03-25T15:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field value and create multiple new fields at search-time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115261#M30513</link>
      <description>&lt;P&gt;This will put an indefinite number of drives into two multi-valued variables.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex max_match=0 "(?P&amp;lt;drive&amp;gt;[A-Z]:)\s(?P&amp;lt;usage&amp;gt;[0-9\.]+)" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can then use the mv* commands to extract the individual drives and usages.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Mar 2015 15:20:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-value-and-create-multiple-new-fields-at/m-p/115261#M30513</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-03-25T15:20:37Z</dc:date>
    </item>
  </channel>
</rss>

