<?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 create new field from a mv comma separated ip value field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-new-field-from-a-mv-comma-separated-ip-value-field/m-p/430335#M123053</link>
    <description>&lt;P&gt;There are a couple of ways to do that (possibly more)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=ip "(?&amp;lt;origin_ip&amp;gt;[^,]+)" | ...

... | eval ips = split(ip, ",") | eval origin_ip = mvindex(ips, 0) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 20 Jun 2019 17:07:01 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2019-06-20T17:07:01Z</dc:date>
    <item>
      <title>How to create new field from a mv comma separated ip value field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-new-field-from-a-mv-comma-separated-ip-value-field/m-p/430334#M123052</link>
      <description>&lt;P&gt;My IP field will come in as the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1.1.1.1,2.2.2.2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to extract the first IP and store it in another field (origin_ip) so that origin_ip's value is solely:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1.1.1.1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:58:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-new-field-from-a-mv-comma-separated-ip-value-field/m-p/430334#M123052</guid>
      <dc:creator>clozach</dc:creator>
      <dc:date>2020-09-30T00:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create new field from a mv comma separated ip value field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-new-field-from-a-mv-comma-separated-ip-value-field/m-p/430335#M123053</link>
      <description>&lt;P&gt;There are a couple of ways to do that (possibly more)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=ip "(?&amp;lt;origin_ip&amp;gt;[^,]+)" | ...

... | eval ips = split(ip, ",") | eval origin_ip = mvindex(ips, 0) | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jun 2019 17:07:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-new-field-from-a-mv-comma-separated-ip-value-field/m-p/430335#M123053</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-06-20T17:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to create new field from a mv comma separated ip value field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-new-field-from-a-mv-comma-separated-ip-value-field/m-p/430336#M123054</link>
      <description>&lt;P&gt;You can do this as a &lt;CODE&gt;calculated field&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval ip="1.1.1.1,2.2.2.2"
| eval origin_ip=replace(ip,",.*$","")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Jun 2019 22:47:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-new-field-from-a-mv-comma-separated-ip-value-field/m-p/430336#M123054</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-06-20T22:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to create new field from a mv comma separated ip value field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-new-field-from-a-mv-comma-separated-ip-value-field/m-p/430337#M123055</link>
      <description>&lt;P&gt;You could try:&lt;BR /&gt;
&lt;PRE&gt;... search stuff ...&lt;BR /&gt;
| eval origin_ip = mvindex(split(myipfield, ","), 0)&lt;/PRE&gt;&lt;/P&gt;

&lt;P&gt;OR&lt;BR /&gt;
&lt;PRE&gt;... search stuff ...&lt;BR /&gt;
| eval origin_ip = replace(myipfield, ",.*", "")&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2019 15:52:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-new-field-from-a-mv-comma-separated-ip-value-field/m-p/430337#M123055</guid>
      <dc:creator>jnudell_2</dc:creator>
      <dc:date>2019-06-21T15:52:25Z</dc:date>
    </item>
  </channel>
</rss>

