<?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 into multiple fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636720#M221123</link>
    <description>&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Sorry to bother you, but is there any way without using mvexpand?&lt;/P&gt;&lt;P&gt;When you use mvexpand, events are created separately,right?&lt;/P&gt;&lt;P&gt;I want add fields to oridinal event.&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2023 14:15:11 GMT</pubDate>
    <dc:creator>Minarai</dc:creator>
    <dc:date>2023-03-30T14:15:11Z</dc:date>
    <item>
      <title>How to split a field into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636616#M221092</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;Lets say there are fields named "raw".&lt;/P&gt;
&lt;P&gt;The values are like this.&lt;/P&gt;
&lt;P&gt;http-header1=value1|http-header2=value2..&lt;/P&gt;
&lt;P&gt;Number of HTTP Headers is 1 to 4.&lt;/P&gt;
&lt;P&gt;ex)&lt;/P&gt;
&lt;P&gt;METHOD=POST|User-Agent=Mozilla|HTTP-CONTENT=img/jpeg&lt;/P&gt;
&lt;P&gt;I'd like to split this field into multiple fields like this.&lt;/P&gt;
&lt;P&gt;field | value&lt;BR /&gt;----------------------+--------------&lt;BR /&gt;raw_http_header1 | value1&lt;BR /&gt;raw_http_header2 | value2&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;ex)&lt;/P&gt;
&lt;P&gt;field | value&lt;/P&gt;
&lt;P&gt;----------------------+--------------&lt;/P&gt;
&lt;P&gt;raw_METHOD | POST&lt;/P&gt;
&lt;P&gt;raw_User_Agent | Mozilla&lt;/P&gt;
&lt;P&gt;raw_HTTP_CONTENT | img/jpeg&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;Notice field name cannot contain "-".&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 07:39:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636616#M221092</guid>
      <dc:creator>Minarai</dc:creator>
      <dc:date>2023-03-30T07:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: Split a field into multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636618#M221093</link>
      <description>&lt;P&gt;Did you want something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval _raw="METHOD=POST|User-Agent=Mozilla|HTTP-CONTENT=img/jpeg"
| extract
| fields - _kv _raw
| transpose 0 column_name="field"
| eval field="raw_".field
| rename "row 1" as value&lt;/LI-CODE&gt;&lt;P&gt;which from the "extract" will create the field/value pairs and make two columns field and value&lt;/P&gt;&lt;P&gt;or did you want a single piece of text with the value separated with a pipe symbol&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 04:07:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636618#M221093</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-03-30T04:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Split a field into multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636619#M221094</link>
      <description>&lt;P&gt;i.e. this variant&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval _raw="METHOD=POST|User-Agent=Mozilla|HTTP-CONTENT=img/jpeg"
| rex field=_raw max_match=0 "(?&amp;lt;field&amp;gt;[^|]*)\|?"
| mvexpand field
| eval field="raw_".replace(field, "=", "|")
| fields - _raw&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 04:10:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636619#M221094</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-03-30T04:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Split a field into multiple fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636625#M221096</link>
      <description>&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;What you showed was really good,&lt;/P&gt;&lt;P&gt;but I want add these fields to search result by using eval command or something.&lt;/P&gt;&lt;P&gt;ex&lt;/P&gt;&lt;P&gt;I want add "rawdata_method" field whose value is "POST".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 05:43:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636625#M221096</guid>
      <dc:creator>Minarai</dc:creator>
      <dc:date>2023-03-30T05:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636650#M221105</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval raw="METHOD=POST|User-Agent=Mozilla|HTTP-CONTENT=img/jpeg"
| eval raw=split(raw,"|")
| mvexpand raw
| rex field=raw "(?&amp;lt;field&amp;gt;[^=]+)=(?&amp;lt;value&amp;gt;.*)"
| eval field="raw_".replace(field,"-","_")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 07:45:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636650#M221105</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-30T07:45:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636720#M221123</link>
      <description>&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Sorry to bother you, but is there any way without using mvexpand?&lt;/P&gt;&lt;P&gt;When you use mvexpand, events are created separately,right?&lt;/P&gt;&lt;P&gt;I want add fields to oridinal event.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 14:15:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636720#M221123</guid>
      <dc:creator>Minarai</dc:creator>
      <dc:date>2023-03-30T14:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636723#M221126</link>
      <description>&lt;LI-CODE lang="markup"&gt;| makeresults
| fields - _time
| eval raw="METHOD=POST|User-Agent=Mozilla|HTTP-CONTENT=img/jpeg"
| rex field=raw max_match=0 "(?&amp;lt;field&amp;gt;[^=]+)=(?&amp;lt;value&amp;gt;[^\|]+)\|?"
| eval field=mvmap(field,"raw_".replace(field,"-","_"))&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 30 Mar 2023 14:20:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/636723#M221126</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-30T14:20:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/637648#M221208</link>
      <description>&lt;P&gt;Thank you for reply!&lt;/P&gt;&lt;P&gt;What I showed you as example was not good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are events like this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=index_main
| table eventID,raw&lt;/LI-CODE&gt;&lt;TABLE border="1" width="44.44331675631787%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;eventID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;raw&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;1&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;METHOD=POST|User-Agent=Mozilla|HTTP-CONTENT=img/jpeg&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;METHOD=GET|Referer=&lt;A href="http://192.168.0.1" target="_blank"&gt;http://192.168.0.1&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;3&lt;/TD&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;METHOD=POST|X-Forwarded-For=10.0.0.1|User-Agent=Firefox&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;The wanted result is like this.&lt;BR /&gt;I want to create new field which name is related http header.&lt;/P&gt;&lt;P&gt;eventID2 does not have User-Agent Header, so you do not add raw_User_Agent field.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| table eventID,raw*&lt;/LI-CODE&gt;&lt;TABLE border="1" width="60.863696847957826%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;&lt;STRONG&gt;eventID&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&lt;STRONG&gt;raw&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="25px"&gt;&lt;STRONG&gt;raw_METHOD&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="2.0833333333333335%" height="25px"&gt;&lt;STRONG&gt;raw_User_Agent&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="1.0416666666666667%" height="25px"&gt;&lt;STRONG&gt;raw_HTTP_CONTENT&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="0.5208333333333334%" height="25px"&gt;&lt;STRONG&gt;raw_Referer&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="0.5208333333333334%" height="25px"&gt;&lt;STRONG&gt;raw_X_Forwarded_For&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="47px"&gt;1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="47px"&gt;METHOD=POST|User-Agent=Mozilla|HTTP-CONTENT=img/jpeg&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="47px"&gt;POST&lt;/TD&gt;&lt;TD width="2.0833333333333335%" height="47px"&gt;Mozilla&lt;/TD&gt;&lt;TD width="1.0416666666666667%" height="47px"&gt;img/jpeg&lt;/TD&gt;&lt;TD width="0.5208333333333334%" height="47px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="0.5208333333333334%" height="47px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="25px"&gt;2&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;METHOD=GET|Referer=&lt;A href="http://192.168.0.1" target="_blank"&gt;http://192.168.0.1&lt;/A&gt;&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="25px"&gt;GET&lt;/TD&gt;&lt;TD width="2.0833333333333335%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="1.0416666666666667%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="0.5208333333333334%" height="25px"&gt;&lt;A href="http://192.168.0.1" target="_blank"&gt;http://192.168.0.1&lt;/A&gt;&lt;/TD&gt;&lt;TD width="0.5208333333333334%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="33.333333333333336%" height="47px"&gt;3&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="47px"&gt;METHOD=POST|X-Forwarded-For=10.0.0.1|User-Agent=Firefox&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="47px"&gt;POST&lt;/TD&gt;&lt;TD width="2.0833333333333335%" height="47px"&gt;Firefox&lt;/TD&gt;&lt;TD width="1.0416666666666667%" height="47px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="0.5208333333333334%" height="47px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="0.5208333333333334%" height="47px"&gt;10.0.0.1&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Sat, 01 Apr 2023 13:54:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/637648#M221208</guid>
      <dc:creator>Minarai</dc:creator>
      <dc:date>2023-04-01T13:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to split a field into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/637683#M221209</link>
      <description>&lt;P&gt;raw_User_Agent is null for eventID 2&lt;/P&gt;&lt;P&gt;This is how tables work! You have rows and columns. Where there is a value for the column it is shown for that row. The cell (row x column) doesn't simply disappear if there is not value to be shown, it is just blank.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Apr 2023 14:03:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-a-field-into-multiple-fields/m-p/637683#M221209</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-04-01T14:03:51Z</dc:date>
    </item>
  </channel>
</rss>

