<?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: Field extraction from data within backslashes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471323#M132604</link>
    <description>&lt;P&gt;I used the same eval but with backslash only and it did not work and I have no idea why, added \n instead like yours and worked perfectly. THANKS!! &lt;/P&gt;

&lt;P&gt;BTW, do you happen to know the reason why just backslash does not get picked up? &lt;/P&gt;

&lt;P&gt;Both yours and @to4kawa solutions work great but rich's solution is less typing :). Accepting RIch's and upvoting t04kawa! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thank you both!&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jun 2020 02:35:43 GMT</pubDate>
    <dc:creator>mbasharat</dc:creator>
    <dc:date>2020-06-04T02:35:43Z</dc:date>
    <item>
      <title>Field extraction from data within backslashes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471320#M132601</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have dateset that contains IP addresses. IP Addresses are coming in variations due to ranges they are assigned to separated by \ backslashes. I need them to be extracted in multiple fields regardless of how many variations are there. See sample data below:&lt;/P&gt;

&lt;P&gt;1.2.3.4\n4.5.6.7\n8.9.1.2&lt;BR /&gt;
1.2.3.4\n4.5.6.7\n&lt;BR /&gt;
1.2.3.4\n4.5.6.7&lt;BR /&gt;
1.2.3.4\n4.5.6.7\n8.9.1.2&lt;/P&gt;

&lt;P&gt;I need them like:&lt;BR /&gt;
1.2.3.4\n4.5.6.7\n8.9.1.2&lt;BR /&gt;
Value1: 1.2.3.4&lt;BR /&gt;
Value2: 4.5.6.7&lt;BR /&gt;
Value3: 8.9.1.2&lt;BR /&gt;
Value4: and so on.....&lt;/P&gt;

&lt;P&gt;So basically all values within backslash, I need them separated out in fields. Also, the letter "n" or any alphabets attached to any IP also needs to go.&lt;/P&gt;

&lt;P&gt;Thanks in-advance!&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2020 19:35:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471320#M132601</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-06-03T19:35:33Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction from data within backslashes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471321#M132602</link>
      <description>&lt;P&gt;The IP addresses are not separated by backslashes, they're separated by newlines &lt;CODE&gt;(\n)&lt;/CODE&gt;.  To split them up, use the &lt;CODE&gt;split&lt;/CODE&gt; command followed by &lt;CODE&gt;mvexpand&lt;/CODE&gt;.  Assuming the addresses are in a field called 'foo', this should do it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval ips = split(foo, "\n") | mvexpand ips
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jun 2020 20:19:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471321#M132602</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-06-03T20:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction from data within backslashes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471322#M132603</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="1.2.3.4\n4.5.6.7\n8.9.1.2
1.2.3.4\n4.5.6.7\n
1.2.3.4\n4.5.6.7
1.2.3.4\n4.5.6.7\n8.9.1.2"
| multikv noheader=t 
| fields _*
| rename COMMENT as "this is sample, check this. from here, the logic"
| rex max_match=0 "(?&amp;lt;data&amp;gt;[\d.]+)"
| streamstats count as session
| mvexpand data
| streamstats count as cols by session
| eval cols="col".cols
| xyseries session cols data
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jun 2020 20:22:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471322#M132603</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-06-03T20:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction from data within backslashes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471323#M132604</link>
      <description>&lt;P&gt;I used the same eval but with backslash only and it did not work and I have no idea why, added \n instead like yours and worked perfectly. THANKS!! &lt;/P&gt;

&lt;P&gt;BTW, do you happen to know the reason why just backslash does not get picked up? &lt;/P&gt;

&lt;P&gt;Both yours and @to4kawa solutions work great but rich's solution is less typing :). Accepting RIch's and upvoting t04kawa! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thank you both!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 02:35:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471323#M132604</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-06-04T02:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction from data within backslashes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471324#M132605</link>
      <description>&lt;P&gt;Both yours and Rich's solutions work great but rich's solution is less typing :). Accepting Rich's and upvoting t04kawa! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thank you both!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 02:36:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471324#M132605</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-06-04T02:36:31Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction from data within backslashes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471325#M132606</link>
      <description>&lt;P&gt;One more thing to add, below also worked:&lt;/P&gt;

&lt;P&gt;| makemv delim="\n" IP_Extracted&lt;BR /&gt;
| mvexpand IP_Extracted&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 05:37:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471325#M132606</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-09-30T05:37:38Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction from data within backslashes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471326#M132607</link>
      <description>&lt;P&gt;Backslash by itself is not picked up because it is the escape character.  That means it modifies the character that follows it.  To match the literal backslash you must escape it &lt;CODE&gt;\\\&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 12:33:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471326#M132607</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-06-04T12:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction from data within backslashes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471327#M132608</link>
      <description>&lt;P&gt;Works. Thanks!!!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jun 2020 13:34:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-from-data-within-backslashes/m-p/471327#M132608</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-06-04T13:34:33Z</dc:date>
    </item>
  </channel>
</rss>

