<?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: Mutlivalue Field Extraction in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Mutlivalue-Field-Extraction/m-p/674843#M112943</link>
    <description>&lt;P&gt;I solved it by using the max_match option in the rex command. The x-forwarded-fors were extracted into a multivalue field &lt;SPAN&gt;x_forwarded_single&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rex field=_raw "^(?P&amp;lt;timestamp&amp;gt;\w+\s\d+\/\d+\/\d+\s.\s\d+:\d+:\d+\.\d+\s\w+\s\w+)\s(?P&amp;lt;remote_hostname&amp;gt;\S+)\s\((?P&amp;lt;x_forwarded_for&amp;gt;[^\)]*)\)\s\&amp;gt;\s(?P&amp;lt;local_ip_address&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(?P&amp;lt;local_port&amp;gt;[\d\-]+)\s\"(?&amp;lt;request&amp;gt;[^\"]+)\"\s(?&amp;lt;request_body_length&amp;gt;\S+)\s(?&amp;lt;time_milli&amp;gt;\S+)\s(?&amp;lt;http_status&amp;gt;\S+)\s(?&amp;lt;bytes_sent&amp;gt;\S+)\s(?&amp;lt;request_thread_name&amp;gt;\S+)\s\"(?&amp;lt;referer&amp;gt;[^\"\s]*)\"\s\"(?&amp;lt;user_agent&amp;gt;[^\"]*)\"\s(?&amp;lt;remote_user&amp;gt;\S+)\s(?&amp;lt;user_session_id&amp;gt;\S+)\s(?&amp;lt;username&amp;gt;\S+)\s(?&amp;lt;session_tracker&amp;gt;\S+)"
| rex field=request "(?&amp;lt;http_method&amp;gt;\w*)\s+(?&amp;lt;url&amp;gt;[^ ]*)\s+(?&amp;lt;http_version&amp;gt;[^\"]+)[^ \n]*"
| rex field=url "(?&amp;lt;uri_path&amp;gt;[^?]+)(?:(?&amp;lt;uri_query&amp;gt;\?.*))?"
| rex field=x_forwarded_for max_match=3 "(?&amp;lt;x_forwarded_single&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 19 Jan 2024 15:01:43 GMT</pubDate>
    <dc:creator>nateloepker</dc:creator>
    <dc:date>2024-01-19T15:01:43Z</dc:date>
    <item>
      <title>Mutlivalue Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mutlivalue-Field-Extraction/m-p/674728#M112925</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm writing some field extractions for a Tomcat access log. The logging format is&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"%{E M/d/y @ hh:mm:ss.S a z}t %h (%{X-Forwarded-For}i) &amp;gt; %A:%p &amp;amp;quot;%r&amp;amp;quot; %{requestBodyLength}r %D %s %B %I &amp;amp;quot;%{Referer}i&amp;amp;quot; &amp;amp;quot;%{User-Agent}i&amp;amp;quot; %u %S %{username}s %{sessionTracker}s"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The X-Forwarded Field has multiple headers, so multiple X-Forwarded-For IP's are being logged for a small, but important, percentage of these events.&lt;/P&gt;&lt;P&gt;An example log is&lt;/P&gt;&lt;P&gt;Thu 1/18/2024 @ 06:52:30.918 PM UTC 00.000.00.000 (00.000.000.000, 00.000.00.00, 00.000.00.00) &amp;gt; 00.000.00.0:0000 "PUT /uri/query/here HTTP/1.1" -&amp;nbsp; 1270 200 3466 https-openssl-nio-00.000.00.0-000-exec-15 "hxxps://url.splunk.com/" "user_agent" - - - -&lt;/P&gt;&lt;P&gt;How can I perform a multivalue field extraction to grab 0, 1, 2 or 3 x-forwarded-for IP's?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jan 2024 19:26:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mutlivalue-Field-Extraction/m-p/674728#M112925</guid>
      <dc:creator>nateloepker</dc:creator>
      <dc:date>2024-01-18T19:26:41Z</dc:date>
    </item>
    <item>
      <title>Re: Mutlivalue Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mutlivalue-Field-Extraction/m-p/674843#M112943</link>
      <description>&lt;P&gt;I solved it by using the max_match option in the rex command. The x-forwarded-fors were extracted into a multivalue field &lt;SPAN&gt;x_forwarded_single&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;| rex field=_raw "^(?P&amp;lt;timestamp&amp;gt;\w+\s\d+\/\d+\/\d+\s.\s\d+:\d+:\d+\.\d+\s\w+\s\w+)\s(?P&amp;lt;remote_hostname&amp;gt;\S+)\s\((?P&amp;lt;x_forwarded_for&amp;gt;[^\)]*)\)\s\&amp;gt;\s(?P&amp;lt;local_ip_address&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}):(?P&amp;lt;local_port&amp;gt;[\d\-]+)\s\"(?&amp;lt;request&amp;gt;[^\"]+)\"\s(?&amp;lt;request_body_length&amp;gt;\S+)\s(?&amp;lt;time_milli&amp;gt;\S+)\s(?&amp;lt;http_status&amp;gt;\S+)\s(?&amp;lt;bytes_sent&amp;gt;\S+)\s(?&amp;lt;request_thread_name&amp;gt;\S+)\s\"(?&amp;lt;referer&amp;gt;[^\"\s]*)\"\s\"(?&amp;lt;user_agent&amp;gt;[^\"]*)\"\s(?&amp;lt;remote_user&amp;gt;\S+)\s(?&amp;lt;user_session_id&amp;gt;\S+)\s(?&amp;lt;username&amp;gt;\S+)\s(?&amp;lt;session_tracker&amp;gt;\S+)"
| rex field=request "(?&amp;lt;http_method&amp;gt;\w*)\s+(?&amp;lt;url&amp;gt;[^ ]*)\s+(?&amp;lt;http_version&amp;gt;[^\"]+)[^ \n]*"
| rex field=url "(?&amp;lt;uri_path&amp;gt;[^?]+)(?:(?&amp;lt;uri_query&amp;gt;\?.*))?"
| rex field=x_forwarded_for max_match=3 "(?&amp;lt;x_forwarded_single&amp;gt;\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 19 Jan 2024 15:01:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mutlivalue-Field-Extraction/m-p/674843#M112943</guid>
      <dc:creator>nateloepker</dc:creator>
      <dc:date>2024-01-19T15:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Mutlivalue Field Extraction</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mutlivalue-Field-Extraction/m-p/674852#M112944</link>
      <description>&lt;PRE&gt;| makeresults &lt;BR /&gt;| eval tmp="Thu 1/18/2024 @ 06:52:30.918 PM UTC 00.000.00.000 (00.000.000.001, 00.000.00.01, 00.000.00.03) &amp;gt; 00.000.00.0:0000 \"PUT /uri/query/here HTTP/1.1\" - 1270 200 3466 https-openssl-nio-00.000.00.0-000-exec-15 \"hxxps://url.splunk.com/\" \"user_agent\" - - - -"&lt;BR /&gt;| rex field=tmp "^(?&amp;lt;timestamp&amp;gt;\w+\s\d+\/\d+\/\d+\s\@\s\d+:\d+:\d+\.\d+\s\w+\s\w+)\s(?&amp;lt;remote_hostname&amp;gt;\S+)\s\((?&amp;lt;x_forwarded_for&amp;gt;[^\)]+).*$"&lt;BR /&gt;| table tmp timestamp remote_hostname x_forwarded_for&lt;BR /&gt;| eval x_forwarded_for=split(replace(x_forwarded_for,"\s",""),",")&lt;/PRE&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;This will auto extract a variable number of x-forwarded-for addresses and place into a multi value field.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jan 2024 16:36:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mutlivalue-Field-Extraction/m-p/674852#M112944</guid>
      <dc:creator>dural_yyz</dc:creator>
      <dc:date>2024-01-19T16:36:44Z</dc:date>
    </item>
  </channel>
</rss>

