<?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 How can a regex query be written to extract source IP address? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627547#M218062</link>
    <description>&lt;P&gt;The position of IP address is getting changed(appearing before or after https) in the logs, in such scenario how regex query can be written to extract source IP address.&lt;/P&gt;
&lt;P&gt;Please guide me.&lt;/P&gt;
&lt;P&gt;Below are the sample logs.&lt;/P&gt;
&lt;P&gt;&amp;lt;14&amp;gt;Jan 19 04:32:59 XXXX&amp;nbsp; accesslog_SIEM: Info: 1674102779.121 7 - 10.130.130.152 TCP_DENIED_SSL/403 0 POST &lt;A href="https://activity.windows.com:443/v3/feeds/me/$batch" target="_blank" rel="noopener"&gt;https://activity.windows.com:443/v3/feeds/me/$batch&lt;/A&gt; - v3/feeds/me/$batch "Domainname\user@Domainname" - DROP_WEBCAT_7-BGC.BlockInternetAccess.DP-DOMPVM.Generalusers.ID-NONE-NONE-NONE-NONE-NONE - 61519 activity.windows.com 443 1 IW_comp 5.0 - - - - - - - - - - - - - - - - - IW_comp - "Computers and Internet" "Unknown" "Unknown" - - 0.00 0 - - - - - - - - - - - - - "SGPlatform 2.0" 21040&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;14&amp;gt;Jan 19 04:32:59 XXXX accesslog_SIEM: Info: 1674102778.930 114 "&lt;A href="https://www.XXX.com/English/home/default.aspx" target="_blank" rel="noopener"&gt;https://www.XXX.com/English/home/default.aspx&lt;/A&gt;" 10.130.80.223 TCP_CLIENT_REFRESH_MISS_SSL/200 785 GET &lt;A href="https://px.ads.linkedin.com:443/collect?v=2&amp;amp;fmt=js&amp;amp;pid=4881225&amp;amp;time=1674102778231&amp;amp;url=https%3A%2F%2Fwww.XXX.com%2FEnglish%2Fhome%2Fdefault.aspx&amp;amp;cookiesTest=true&amp;amp;liSync=true" target="_blank" rel="noopener"&gt;https://px.ads.linkedin.com:443/collect?v=2&amp;amp;fmt=js&amp;amp;pid=4881225&amp;amp;time=1674102778231&amp;amp;url=https%3A%2F%2Fwww.XXX.com%2FEnglish%2Fhome%2Fdefault.aspx&amp;amp;cookiesTest=true&amp;amp;liSync=true&lt;/A&gt; px.ads.linkedin.com collect?v=2&amp;amp;fmt=js&amp;amp;pid=4881225&amp;amp;time=1674102778231&amp;amp;url=https%3A%2F%2Fwww.XXX.com%2FEnglish%2Fhome%2Fdefault.aspx&amp;amp;cookiesTest=true&amp;amp;liSync=true - application/javascript ALLOW_CUSTOMCAT_12-ZAMLUM.FullAccess.AP-AuthByPass.ID-NONE-NONE-NONE-DefaultGroup-NONE - 54083 px.ads.linkedin.com 443 1 C_Allo 4.0 - - - - - - - - - - - - - - - - - IW_snet - "Social Networking" "Unknown" "Unknown" - - 55.09 0 - - - - - - - - - - - - - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) browser/2020.2.6 Chrome/87.0.4280.141 Electron/11.3.99 Safari/537.36 PingdomTMS/2020.2" 1162&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jan 2023 18:17:10 GMT</pubDate>
    <dc:creator>Daksesh</dc:creator>
    <dc:date>2023-01-19T18:17:10Z</dc:date>
    <item>
      <title>How can a regex query be written to extract source IP address?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627547#M218062</link>
      <description>&lt;P&gt;The position of IP address is getting changed(appearing before or after https) in the logs, in such scenario how regex query can be written to extract source IP address.&lt;/P&gt;
&lt;P&gt;Please guide me.&lt;/P&gt;
&lt;P&gt;Below are the sample logs.&lt;/P&gt;
&lt;P&gt;&amp;lt;14&amp;gt;Jan 19 04:32:59 XXXX&amp;nbsp; accesslog_SIEM: Info: 1674102779.121 7 - 10.130.130.152 TCP_DENIED_SSL/403 0 POST &lt;A href="https://activity.windows.com:443/v3/feeds/me/$batch" target="_blank" rel="noopener"&gt;https://activity.windows.com:443/v3/feeds/me/$batch&lt;/A&gt; - v3/feeds/me/$batch "Domainname\user@Domainname" - DROP_WEBCAT_7-BGC.BlockInternetAccess.DP-DOMPVM.Generalusers.ID-NONE-NONE-NONE-NONE-NONE - 61519 activity.windows.com 443 1 IW_comp 5.0 - - - - - - - - - - - - - - - - - IW_comp - "Computers and Internet" "Unknown" "Unknown" - - 0.00 0 - - - - - - - - - - - - - "SGPlatform 2.0" 21040&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;14&amp;gt;Jan 19 04:32:59 XXXX accesslog_SIEM: Info: 1674102778.930 114 "&lt;A href="https://www.XXX.com/English/home/default.aspx" target="_blank" rel="noopener"&gt;https://www.XXX.com/English/home/default.aspx&lt;/A&gt;" 10.130.80.223 TCP_CLIENT_REFRESH_MISS_SSL/200 785 GET &lt;A href="https://px.ads.linkedin.com:443/collect?v=2&amp;amp;fmt=js&amp;amp;pid=4881225&amp;amp;time=1674102778231&amp;amp;url=https%3A%2F%2Fwww.XXX.com%2FEnglish%2Fhome%2Fdefault.aspx&amp;amp;cookiesTest=true&amp;amp;liSync=true" target="_blank" rel="noopener"&gt;https://px.ads.linkedin.com:443/collect?v=2&amp;amp;fmt=js&amp;amp;pid=4881225&amp;amp;time=1674102778231&amp;amp;url=https%3A%2F%2Fwww.XXX.com%2FEnglish%2Fhome%2Fdefault.aspx&amp;amp;cookiesTest=true&amp;amp;liSync=true&lt;/A&gt; px.ads.linkedin.com collect?v=2&amp;amp;fmt=js&amp;amp;pid=4881225&amp;amp;time=1674102778231&amp;amp;url=https%3A%2F%2Fwww.XXX.com%2FEnglish%2Fhome%2Fdefault.aspx&amp;amp;cookiesTest=true&amp;amp;liSync=true - application/javascript ALLOW_CUSTOMCAT_12-ZAMLUM.FullAccess.AP-AuthByPass.ID-NONE-NONE-NONE-DefaultGroup-NONE - 54083 px.ads.linkedin.com 443 1 C_Allo 4.0 - - - - - - - - - - - - - - - - - IW_snet - "Social Networking" "Unknown" "Unknown" - - 55.09 0 - - - - - - - - - - - - - "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) browser/2020.2.6 Chrome/87.0.4280.141 Electron/11.3.99 Safari/537.36 PingdomTMS/2020.2" 1162&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 18:17:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627547#M218062</guid>
      <dc:creator>Daksesh</dc:creator>
      <dc:date>2023-01-19T18:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: Field extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627555#M218066</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "^.+[^\d](?&amp;lt;ipaddress&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Jan 2023 09:13:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627555#M218066</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-01-19T09:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Field extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627567#M218068</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;The output of above command gives results both source IP address(10.130.130.33) and destination IP address(192.111.4.115) in the same field ipaddress.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would like to separate Source IP address and Destination IP address in props.conf file in Heavy forwarder. Could you please help on this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the sample log line.&lt;/P&gt;&lt;P&gt;&amp;lt;14&amp;gt;Jan 19 04:32:59 xxxxx accesslog_SIEM: Info: 1674102779.144 250 - 10.130.130.33 TCP_MISS_SSL/200 0 TCP_CONNECT 192.111.4.115:443 cloud-ec-asn.amp.cisco.com - - - DECRYPT_ADMIN_2-NONE-DOMPVM.Generalusers.ID-NONE-NONE-NONE-DefaultGroup-NONE - 55009 cloud-ec-asn.amp.cisco.com 443 2 IW_comp 9.4 1 - - - - - - - - - - - - - - - - IW_comp - "Computers and Internet" "Unknown" "Unknown" - - 0.00 0 - - - - - - - - - - - - - - 0&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 11:27:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627567#M218068</guid>
      <dc:creator>Daksesh</dc:creator>
      <dc:date>2023-01-19T11:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Field extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627576#M218069</link>
      <description>&lt;P&gt;You need to identify some additional text anchors for the pattern matching, for example, is source IP always followed by " TCP_", and, if present, is destination IP always followed by ":" (and a port number)?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "^.+[^\d](?&amp;lt;srcipaddress&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) TCP_(.+[^\d](?&amp;lt;dstipaddress&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):\d)?"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 19 Jan 2023 13:06:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627576#M218069</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-01-19T13:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Field extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627726#M218109</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;Thank you for your inputs.&lt;/P&gt;&lt;P&gt;I have written same regex in the props.conf file in Splunk heavy forwarder, but field extractions are not happening in search head.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please guide me if there is any mistake from my end. Below is the props.conf file&lt;/P&gt;&lt;P&gt;[user@XXXXX local]$ cat props.conf&lt;BR /&gt;[cp_log1]&lt;BR /&gt;category = Custom&lt;BR /&gt;pulldown_type = 1&lt;/P&gt;&lt;P&gt;[wsa_test]&lt;BR /&gt;category = Custom&lt;BR /&gt;EXTRACT-src_ipaddress = .+[^\d](?&amp;lt;ipaddress&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})&lt;BR /&gt;EXTRACT-dest_ipaddress = TCP_(.+[^\d](?&amp;lt;dstipaddress&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):\d)&lt;BR /&gt;EXTRACT-domain = https?:\/\/(?&amp;lt;domain&amp;gt;.*?(?:.com|.net))&lt;BR /&gt;EXTRACT-username = GOLDBAR\\(?&amp;lt;username&amp;gt;[\w]+)&lt;BR /&gt;pulldown_type = 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2023 12:00:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627726#M218109</guid>
      <dc:creator>Daksesh</dc:creator>
      <dc:date>2023-01-20T12:00:30Z</dc:date>
    </item>
    <item>
      <title>Re: Field extractions</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627936#M218155</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Had written regex in the props.conf file, but field extractions are not observing in Search head. Please find the below configuration. could you please guide me if anything to be included in props.conf file.&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 05:35:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-a-regex-query-be-written-to-extract-source-IP-address/m-p/627936#M218155</guid>
      <dc:creator>Daksesh</dc:creator>
      <dc:date>2023-01-23T05:35:53Z</dc:date>
    </item>
  </channel>
</rss>

