<?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 multiple IP addresses from _raw and assign same field name in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345790#M63534</link>
    <description>&lt;P&gt;The quotation marks around field names aren't needed if you highlight that text and click the '101010' button.&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2017 15:10:11 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2017-04-25T15:10:11Z</dc:date>
    <item>
      <title>Extract multiple IP addresses from _raw and assign same field name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345789#M63533</link>
      <description>&lt;P&gt;I am trying to extract all IP addresses from _raw with a field name of rf_ip so that I can use this value to do a lookup for any IP in the logs that match, but I seem to have something configured incorrectly. &lt;/P&gt;

&lt;P&gt;I have tested the regex in regex101 and within splunk using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw "(?&amp;lt;"rf_ip"&amp;gt;\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)" max_match=0 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(I have "" around &amp;lt;"rf_ip"&amp;gt; so it will show up in the forum)&lt;/P&gt;

&lt;P&gt;Here are my configs:&lt;BR /&gt;
On HFs&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rf_ip]

1. REGEX = (?&amp;lt;"rf_ip"&amp;gt;\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b)
(I have "" around &amp;lt;"rf_ip"&amp;gt; so it will show up in the forum)
2. SOURCE_KEY = _raw
3. MV_ADD = true
4. CAN_OPTIMIZE = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[infoblox:dns]
TRANSFORMS-rfip = rf_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;ES search head /etc/system/local&lt;BR /&gt;
fields.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rf_ip]
INDEXED = True
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Splunk design:&lt;BR /&gt;
Universal forwarders or syslog =&amp;gt; HF =&amp;gt; indexers =&amp;gt; ES search head&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:48:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345789#M63533</guid>
      <dc:creator>kaw243</dc:creator>
      <dc:date>2020-09-29T13:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple IP addresses from _raw and assign same field name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345790#M63534</link>
      <description>&lt;P&gt;The quotation marks around field names aren't needed if you highlight that text and click the '101010' button.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 15:10:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345790#M63534</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-04-25T15:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple IP addresses from _raw and assign same field name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345791#M63535</link>
      <description>&lt;P&gt;A couple of issues here:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Don't use indexed fields for this. Unless you have a &lt;EM&gt;very&lt;/EM&gt; specific reason for trying to use an indexed field you're just causing more issues than you're solving.&lt;/LI&gt;
&lt;LI&gt;Because of your use of indexed fields, the MV_ADD does not work.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;A fix is going to be using search time fields like so:&lt;BR /&gt;
props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rf_ip]
REPORT_rfip = rf_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rf_ip]
REGEX = \b(?&amp;lt;rf_ip&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\b
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Lastly, remove your fields.conf. All of this needs to exist on the Search Head, as it's a search time configuration. &lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 16:54:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345791#M63535</guid>
      <dc:creator>beatus</dc:creator>
      <dc:date>2017-04-25T16:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple IP addresses from _raw and assign same field name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345792#M63536</link>
      <description>&lt;P&gt;I removed the configs from the HF as well as the fields.conf from my search head.  I also added the above (without the "" around rf_ip) to my search head in /etc/system/local and restarted it, but I am still not seeing the rf_ip field extracted.  &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:48:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345792#M63536</guid>
      <dc:creator>kaw243</dc:creator>
      <dc:date>2020-09-29T13:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple IP addresses from _raw and assign same field name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345793#M63537</link>
      <description>&lt;P&gt;Can you share some sample data?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 18:31:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345793#M63537</guid>
      <dc:creator>beatus</dc:creator>
      <dc:date>2017-04-25T18:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple IP addresses from _raw and assign same field name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345794#M63538</link>
      <description>&lt;P&gt;Here are a few sample logs. &lt;/P&gt;

&lt;P&gt;Apr 25 13:40:06 aws1oainblx001.xxx.corp 12.123.32.50 named[669]: 25-Apr-2017 13:40:06.365 client 112.128.532.20#3876: view 3: UDP: query: assets.locuslabs.com IN A response: NOERROR + assets.locuslabs.com. 60 IN A 53.192.139.36; assets.locuslabs.com. 60 IN A 51.2.39.84; assets.locuslabs.com. 60 IN A 54.142.13.2; assets.locuslabs.com. 60 IN A 52.19.9.65; assets.locuslabs.com. 60 IN A 54.122.39.11; assets.locuslabs.com. 60 IN A 53.92.1.101; assets.locuslabs.com. 60 IN A 54.112.19.0; assets.locuslabs.com. 60 IN A 54.12.19.18;&lt;/P&gt;

&lt;P&gt;Apr 25 13:40:06 aws1dsfdn102.xxx.corp 134.45.88.163 named[9622]: 25-Apr-2017 13:40:06.994 client 140.44.112.233#3470: UDP: query: localhost.nao.xxx.com IN A response: NXDOMAIN +&lt;/P&gt;

&lt;P&gt;time=1493145885|loc=4388995|fileid=1493096349|action=drop|orig=xxx_FW|i/f_dir=inbound|i/f_name=eth1-04|has_accounting=0|uuid=&amp;lt;00000000,00000000,00000000,00000000&amp;gt;|product=VPN-1 &amp;amp; FireWall-1|TCP packet out of state=First packet isn't SYN|tcp_flags=FIN-ACK|src=h-132.129.113.177|s_port=24543|dst=129.65.119.203|service=http|proto=tcp|__policy_id_tag=product=VPN-1 &amp;amp; FireWall-1[db_tag={7460A7102-C6476-A4E43-9C37A-E870A497F5537};mgmt=xxx_cma;date=1492733045;policy_name=xxx]|origin_sic_name=CN=xxx_FW,O=xxx_cma..xxx&lt;/P&gt;

&lt;P&gt;Apr 25 13:49:14 aws.xxx.corp 110.40.32.50 named[669]: 25-Apr-2017 13:49:14.898 client 122.168.52.210#62481: view 3: UDP: query: guzzoni.apple.com IN A response: NOERROR + guzzoni.apple.com. 120 IN CNAME origin.guzzoni-apple.com.akadns.net.; origin.guzzoni-apple.com.akadns.net. 241 IN CNAME st14p01sa.guzzoni-apple.com.akadns.net.; st14p01sa.guzzoni-apple.com.akadns.net. 298 IN A 127.174.1.5;&lt;/P&gt;

&lt;P&gt;Apr 25 13:49:14 xxx.xxx.corp 120.40.32.50 named[669]: client 112.168.52.210#62481 (guzzoni.apple.com): view 3: query: guzzoni.apple.com IN A + (120.40.32.50)&lt;/P&gt;

&lt;P&gt;Apr 25 13:49:14 xxx.xxx.corp 130.40.32.50 named[669]: 25-Apr-2017 13:49:14.894 client 192.168.52.210#63019: view 3: UDP: query: apple.com IN A response: NOERROR + apple.com. 1350 IN A 197.172.224.47; apple.com. 1350 IN A 147.178.96.59; apple.com. 1350 IN A 170.142.160.59;&lt;/P&gt;

&lt;P&gt;Apr 25 13:49:14 xxx.xxx.corp 170.40.32.50 named[669]: client 190.168.52.210#63019 (apple.com): view 3: query: apple.com IN A + (134.140.32.50)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:48:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345794#M63538</guid>
      <dc:creator>kaw243</dc:creator>
      <dc:date>2020-09-29T13:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple IP addresses from _raw and assign same field name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345795#M63539</link>
      <description>&lt;P&gt;Okay, lets change our regular expression to match this a bit better then:&lt;/P&gt;

&lt;P&gt;Props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rf_ip]
REPORT_rfip = rf_ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[rf_ip]
REGEX = \b(?&amp;lt;rf_ip&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\b
MV_ADD = true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here's the result on my box:&lt;BR /&gt;
&lt;IMG src="http://i.imgur.com/97QxXcj.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 13:33:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345795#M63539</guid>
      <dc:creator>beatus</dc:creator>
      <dc:date>2017-04-26T13:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple IP addresses from _raw and assign same field name</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345796#M63540</link>
      <description>&lt;P&gt;Thanks beatus for your help with this, it was greatly appreciated.&lt;/P&gt;

&lt;P&gt;The final config that worked for me is&lt;BR /&gt;
props.conf&lt;BR /&gt;
[(?::){0}*] &amp;lt;== used this to use for all source type&lt;BR /&gt;
REPORT-rf_ip = rf_ip &amp;lt;== updated this from REPORT_rf to REPORT-rf&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
[rf_ip]&lt;BR /&gt;
REGEX = \b(?\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3})\b&lt;BR /&gt;
MV_ADD = true&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:48:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Extract-multiple-IP-addresses-from-raw-and-assign-same-field/m-p/345796#M63540</guid>
      <dc:creator>kaw243</dc:creator>
      <dc:date>2020-09-29T13:48:58Z</dc:date>
    </item>
  </channel>
</rss>

