<?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: Extract backslash separated field to multiple field ? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701123#M10310</link>
    <description>&lt;P&gt;The fields can be extracted using the &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command or by using the &lt;FONT face="courier new,courier"&gt;split&lt;/FONT&gt; function (and perhaps others).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval FIELDS = split(FIELD1, "/")&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;| rex field=FIELD1 max_match=0 "(?&amp;lt;FIELDS&amp;gt;[^\/]+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both commands will extract the fields into a multi-value field so iyou'll need to assign them to separate fields.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach 1 2 3 4 5 6 7 
    [eval FIELD_&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=mvindex(FIELDS,&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;-1)]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 06 Oct 2024 16:11:57 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2024-10-06T16:11:57Z</dc:date>
    <item>
      <title>Extract backslash separated field to multiple field ?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701116#M10309</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;BR /&gt;Can someone please help me to extract the multiple fields from a single backslash separated field using rex command.&amp;nbsp;&lt;/P&gt;&lt;P&gt;FIELD1 =&amp;nbsp;ABCD/EFGH/IJ/KL/MN/OP/QRST&lt;/P&gt;&lt;P&gt;How to create the multiple fields using the field FIELD1 as below :&lt;/P&gt;&lt;P&gt;Field_1 =&amp;nbsp;ABCD&amp;nbsp;&lt;BR /&gt;Field_2 = EFGH&lt;BR /&gt;Field_3 = IJ&lt;BR /&gt;Field_4 = KL&lt;BR /&gt;Field_5 = MN&lt;BR /&gt;Field_6 = OP&lt;BR /&gt;&lt;SPAN&gt;Field_7 =&lt;/SPAN&gt;&lt;SPAN&gt; QRST&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2024 14:50:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701116#M10309</guid>
      <dc:creator>Real_captain</dc:creator>
      <dc:date>2024-10-06T14:50:28Z</dc:date>
    </item>
    <item>
      <title>How to extract multiple fields from a backslashseperated single field ?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701119#M10313</link>
      <description>&lt;P class="lia-align-left"&gt;Hi Team&lt;BR /&gt;Can someone please help me to extract the backslash separated field into multiple fields ?&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Example : Field is present in Splunk as below :&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Field =&amp;nbsp;ABCD/EFG6/CR/IN/OU/XY/BMW&lt;/P&gt;&lt;P class="lia-align-left"&gt;I need to use the rex command to extract the able field into 7 fields as below:&lt;/P&gt;&lt;P class="lia-align-left"&gt;Field_1 = ABCD&lt;BR /&gt;Field_2 = EFG6&lt;BR /&gt;Field_3 = CR&lt;BR /&gt;Field_4 = IN&lt;BR /&gt;Field_5 = OU&lt;BR /&gt;Field_6 = XY&lt;BR /&gt;Field_7 = BMW&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;In case value of the file is below :&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Field =&amp;nbsp;ABCD&amp;nbsp;&lt;BR /&gt;Then rex command generates the 7 fields as below :&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;Field_1 = ABCD&lt;BR /&gt;Field_2 =&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Field_3 =&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Field_4 =&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Field_5 =&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Field_6 =&amp;nbsp;&amp;nbsp;&lt;BR /&gt;Field_7 =&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2024 15:03:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701119#M10313</guid>
      <dc:creator>Real_captain</dc:creator>
      <dc:date>2024-10-06T15:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract multiple fields from a backslashseperated single field ?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701121#M10314</link>
      <description>&lt;P&gt;1. Those are slashes, not backslashes&lt;/P&gt;&lt;P&gt;2. Is the number of fields constant? If not, you can't use regex alone to split it into fields.&lt;/P&gt;&lt;P&gt;3. Isn't splitting the string with the eval split() function enough?&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2024 15:20:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701121#M10314</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-10-06T15:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract backslash separated field to multiple field ?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701123#M10310</link>
      <description>&lt;P&gt;The fields can be extracted using the &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; command or by using the &lt;FONT face="courier new,courier"&gt;split&lt;/FONT&gt; function (and perhaps others).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval FIELDS = split(FIELD1, "/")&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;| rex field=FIELD1 max_match=0 "(?&amp;lt;FIELDS&amp;gt;[^\/]+)"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both commands will extract the fields into a multi-value field so iyou'll need to assign them to separate fields.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach 1 2 3 4 5 6 7 
    [eval FIELD_&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=mvindex(FIELDS,&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;-1)]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 06 Oct 2024 16:11:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701123#M10310</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-10-06T16:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract multiple fields from a backslashseperated single field ?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701144#M10315</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263966"&gt;@Real_captain&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;This straight forward method may not work if your data format is changed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using the "split" Command will be simple and effective method.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|makeresults | eval FIELD1 = "ABCD/EFGH/IJ/KL/MN/OP/QRST" 
| rex field=FIELD1 "(?P&amp;lt;Field_1&amp;gt;\w+)\/(?P&amp;lt;Field_2&amp;gt;\w+)\/(?P&amp;lt;Field_3&amp;gt;\w+)\/(?P&amp;lt;Field_4&amp;gt;\w+)\/(?P&amp;lt;Field_5&amp;gt;\w+)\/(?P&amp;lt;Field_6&amp;gt;\w+)\/(?P&amp;lt;Field_7&amp;gt;\w+)"
| table FIELD1 Field_1 Field_2 Field_3 Field_4 Field_5 Field_6 Field_7&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="inventsekar_0-1728277767527.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32972i37CF4824B2369838/image-size/medium?v=v2&amp;amp;px=400" role="button" title="inventsekar_0-1728277767527.png" alt="inventsekar_0-1728277767527.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2024 05:12:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701144#M10315</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2024-10-07T05:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract multiple fields from a backslashseperated single field ?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701516#M10316</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/263966"&gt;@Real_captain&lt;/a&gt;&amp;nbsp;May i know if the issue is resolved or not yet, thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Oct 2024 10:30:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/Extract-backslash-separated-field-to-multiple-field/m-p/701516#M10316</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2024-10-10T10:30:50Z</dc:date>
    </item>
  </channel>
</rss>

