<?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 modify access_combined field definitions to include spaces in uri field? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-access-combined-field-definitions-to-include/m-p/439809#M76700</link>
    <description>&lt;P&gt;Here are the details:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
|  eval _raw = "1.1.1.1 80 - [07/Aug/2019:21:43:37 +0000] \"GET /demo_bin/resource.php?command= space and another space and some more spaces  in between HTTP/1.1\" 400 583 \"-\" \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\" \"-\" \"-\""
| rename COMMENT AS "This is 'access-extractions' from '/opt/splunk/etc/system/local/transforms.conf'"
| rename COMMENT AS "^[[nspaces:clientip]]\s++[[nspaces:ident]]\s++[[nspaces:user]]\s++[[sbstring:req_time]]\s++[[access-request]]\s++[[nspaces:status]]\s++[[nspaces:bytes]](?:\s++\"(?&amp;lt;referer&amp;gt;[[bc_domain:referer_]]?+[^\"]*+)\"(?:\s++[[qstring:useragent]](?:\s++[[qstring:cookie]])?+)?+)?[[all:other]]"
| rename COMMENT AS "This is 'access-request' from '/opt/splunk/etc/system/local/transforms.conf'"
| rename COMMENT AS "\s*+[[reqstr:method]]?(?:\s++[[bc_uri]](?:\s++[[reqstr:version]])*)?\s*+"
| rename COMMENT AS "This is 'bc_uri' from '/opt/splunk/etc/system/local/transforms.conf'"
| rex "(?&amp;lt;uri&amp;gt;[[bc_domain:uri_]]?+(?&amp;lt;uri_path&amp;gt;[[uri_root]]?[[uri_seg]]*(?&amp;lt;file&amp;gt;[^\s\?/]+)?)(?:\?(?&amp;lt;uri_query&amp;gt;[^\s]*))?)"
| rex mode=sed "s/.*\"\w+\s+//"
| rename COMMENT AS "Let's modify it to fix it..."
| rex "(?&amp;lt;uri&amp;gt;[[bc_domain:uri_]]?+(?&amp;lt;uri_path&amp;gt;[[uri_root]]?[[uri_seg]]*(?&amp;lt;file&amp;gt;[^\s\?/]+)?)(?:\?(?&amp;lt;uri_query&amp;gt;[^\s]*(?:\s+[^\"]+))?)?)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So you need to create an updated definition for &lt;CODE&gt;bc_uri&lt;/CODE&gt; along the lines of what I did in the last line above and put it someplace where the &lt;CODE&gt;transforms.conf&lt;/CODE&gt; will have &lt;CODE&gt;global&lt;/CODE&gt; scope &lt;CODE&gt;preferences&lt;/CODE&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Aug 2019 20:28:23 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-08-16T20:28:23Z</dc:date>
    <item>
      <title>How to modify access_combined field definitions to include spaces in uri field?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-access-combined-field-definitions-to-include/m-p/439806#M76697</link>
      <description>&lt;P&gt;I recently discovered the access_combined field definitions don't properly parse the &lt;CODE&gt;uri&lt;/CODE&gt; fields if it includes a space. I understand the reasoning as spaces are largely regarded as invalid and should be escaped with %20 – however that shouldn't have any bearing on parsing the result in Splunk.&lt;/P&gt;

&lt;P&gt;How can I modify the &lt;CODE&gt;access_combined&lt;/CODE&gt; field definitions via &lt;CODE&gt;transforms.conf&lt;/CODE&gt; to include spaces in the &lt;CODE&gt;uri&lt;/CODE&gt; field?&lt;/P&gt;

&lt;P&gt;Example event with spaces in the &lt;CODE&gt;uri&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;1.1.1.1 80 - [07/Aug/2019:21:43:37 +0000] "GET /demo_bin/resource.php?command= space and another space and some more spaces  in between HTTP/1.1" 400 583 "-" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" "-" "-"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Aug 2019 00:56:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-access-combined-field-definitions-to-include/m-p/439806#M76697</guid>
      <dc:creator>orion44</dc:creator>
      <dc:date>2019-08-08T00:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify access_combined field definitions to include spaces in uri field?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-access-combined-field-definitions-to-include/m-p/439807#M76698</link>
      <description>&lt;P&gt;It is not common for spaces to even exist so you would have to post some sample raw events if you'd like anybody to help.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 01:22:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-access-combined-field-definitions-to-include/m-p/439807#M76698</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-08-08T01:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify access_combined field definitions to include spaces in uri field?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-access-combined-field-definitions-to-include/m-p/439808#M76699</link>
      <description>&lt;P&gt;Updated question to include example event&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2019 01:46:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-access-combined-field-definitions-to-include/m-p/439808#M76699</guid>
      <dc:creator>orion44</dc:creator>
      <dc:date>2019-08-08T01:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify access_combined field definitions to include spaces in uri field?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-access-combined-field-definitions-to-include/m-p/439809#M76700</link>
      <description>&lt;P&gt;Here are the details:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
|  eval _raw = "1.1.1.1 80 - [07/Aug/2019:21:43:37 +0000] \"GET /demo_bin/resource.php?command= space and another space and some more spaces  in between HTTP/1.1\" 400 583 \"-\" \"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)\" \"-\" \"-\""
| rename COMMENT AS "This is 'access-extractions' from '/opt/splunk/etc/system/local/transforms.conf'"
| rename COMMENT AS "^[[nspaces:clientip]]\s++[[nspaces:ident]]\s++[[nspaces:user]]\s++[[sbstring:req_time]]\s++[[access-request]]\s++[[nspaces:status]]\s++[[nspaces:bytes]](?:\s++\"(?&amp;lt;referer&amp;gt;[[bc_domain:referer_]]?+[^\"]*+)\"(?:\s++[[qstring:useragent]](?:\s++[[qstring:cookie]])?+)?+)?[[all:other]]"
| rename COMMENT AS "This is 'access-request' from '/opt/splunk/etc/system/local/transforms.conf'"
| rename COMMENT AS "\s*+[[reqstr:method]]?(?:\s++[[bc_uri]](?:\s++[[reqstr:version]])*)?\s*+"
| rename COMMENT AS "This is 'bc_uri' from '/opt/splunk/etc/system/local/transforms.conf'"
| rex "(?&amp;lt;uri&amp;gt;[[bc_domain:uri_]]?+(?&amp;lt;uri_path&amp;gt;[[uri_root]]?[[uri_seg]]*(?&amp;lt;file&amp;gt;[^\s\?/]+)?)(?:\?(?&amp;lt;uri_query&amp;gt;[^\s]*))?)"
| rex mode=sed "s/.*\"\w+\s+//"
| rename COMMENT AS "Let's modify it to fix it..."
| rex "(?&amp;lt;uri&amp;gt;[[bc_domain:uri_]]?+(?&amp;lt;uri_path&amp;gt;[[uri_root]]?[[uri_seg]]*(?&amp;lt;file&amp;gt;[^\s\?/]+)?)(?:\?(?&amp;lt;uri_query&amp;gt;[^\s]*(?:\s+[^\"]+))?)?)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So you need to create an updated definition for &lt;CODE&gt;bc_uri&lt;/CODE&gt; along the lines of what I did in the last line above and put it someplace where the &lt;CODE&gt;transforms.conf&lt;/CODE&gt; will have &lt;CODE&gt;global&lt;/CODE&gt; scope &lt;CODE&gt;preferences&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Aug 2019 20:28:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-access-combined-field-definitions-to-include/m-p/439809#M76700</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-08-16T20:28:23Z</dc:date>
    </item>
  </channel>
</rss>

