<?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 Inconsistent number of spaces in a space-delimited event. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Inconsistent-number-of-spaces-in-a-space-delimited-event/m-p/57621#M14054</link>
    <description>&lt;P&gt;Oh hai.&lt;/P&gt;

&lt;P&gt;So I have some logs from a web cache. Here's an example (note the spaces between 'TimeStamp' &amp;amp; 'Operation' in the header):&lt;/P&gt;

&lt;PRE&gt;TimeStamp        Operation Priority URL
1281654000.385657  refreshed 0.7850 &lt;A href="http://xxx.xxx.xxx/drm4/OnlineMovies/DWS/28/836/summersam_270x390.jpg.http" target="test_blank"&gt;http://xxx.xxx.xxx/drm4/OnlineMovies/DWS/28/836/summersam_270x390.jpg.http&lt;/A&gt;
#Number of transaction records: 1&lt;/PRE&gt;

&lt;P&gt;My &lt;STRONG&gt;props.conf&lt;/STRONG&gt; for this sourcetype is:&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[cache_content]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;pulldown_type=true&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;KV_MODE=none&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;SHOULD_LINEMERGE=false&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TZ=Australia/Melbourne&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TRANSFORMS-toNull=cache_content_header,cache_content_comment&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;REPORT-cacheContentFields=cache_content_fields&lt;/CODE&gt;&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;My &lt;STRONG&gt;transforms.conf&lt;/STRONG&gt; is as follows:&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[cache_content_header]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;REGEX = ^T&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;DEST_KEY = queue&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;FORMAT = nullQueue&lt;/CODE&gt;&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[cache_content_comment]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;REGEX = ^#&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;DEST_KEY = queue&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;FORMAT = nullQueue&lt;/CODE&gt;&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[cache_content_fields]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;DELIMS = " "&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;FIELDS = "TimeStamp", "Operation", "Priority", "URL"&lt;/CODE&gt;
&lt;/P&gt;&lt;HR /&gt;
Given this example, the fields are extracted as follows (visible in the field picker):&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;TimeStamp&lt;/CODE&gt; = &lt;CODE&gt;1281654000.385657&lt;/CODE&gt; (yep that's fine)&lt;BR /&gt;
&lt;CODE&gt;Operation&lt;/CODE&gt;... Doesn't show up in list of available fields (default behavior with zero value?)&lt;BR /&gt;
&lt;CODE&gt;Priority&lt;/CODE&gt; = &lt;CODE&gt;refreshed&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;URL&lt;/CODE&gt; = &lt;CODE&gt;0.7850&lt;/CODE&gt;&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;I've checked for special characters (eg. tabs) in vi and there are none, so it looks as though the number of spaces is the issue, with nothing being allocated to the &lt;CODE&gt;Operation&lt;/CODE&gt; field, and this throwing the subsequent extractions out.&lt;/P&gt;

&lt;P&gt;The transforms.conf doco doesn't cover off the use of REGEX's in the DELIM statement, so I'm wondering what I can do here.&lt;/P&gt;

&lt;P&gt;As always, any help would be greatly appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2011 11:26:51 GMT</pubDate>
    <dc:creator>rturk</dc:creator>
    <dc:date>2011-03-11T11:26:51Z</dc:date>
    <item>
      <title>Inconsistent number of spaces in a space-delimited event.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inconsistent-number-of-spaces-in-a-space-delimited-event/m-p/57621#M14054</link>
      <description>&lt;P&gt;Oh hai.&lt;/P&gt;

&lt;P&gt;So I have some logs from a web cache. Here's an example (note the spaces between 'TimeStamp' &amp;amp; 'Operation' in the header):&lt;/P&gt;

&lt;PRE&gt;TimeStamp        Operation Priority URL
1281654000.385657  refreshed 0.7850 &lt;A href="http://xxx.xxx.xxx/drm4/OnlineMovies/DWS/28/836/summersam_270x390.jpg.http" target="test_blank"&gt;http://xxx.xxx.xxx/drm4/OnlineMovies/DWS/28/836/summersam_270x390.jpg.http&lt;/A&gt;
#Number of transaction records: 1&lt;/PRE&gt;

&lt;P&gt;My &lt;STRONG&gt;props.conf&lt;/STRONG&gt; for this sourcetype is:&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[cache_content]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;pulldown_type=true&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;KV_MODE=none&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;SHOULD_LINEMERGE=false&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TZ=Australia/Melbourne&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;TRANSFORMS-toNull=cache_content_header,cache_content_comment&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;REPORT-cacheContentFields=cache_content_fields&lt;/CODE&gt;&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;My &lt;STRONG&gt;transforms.conf&lt;/STRONG&gt; is as follows:&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[cache_content_header]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;REGEX = ^T&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;DEST_KEY = queue&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;FORMAT = nullQueue&lt;/CODE&gt;&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[cache_content_comment]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;REGEX = ^#&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;DEST_KEY = queue&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;FORMAT = nullQueue&lt;/CODE&gt;&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[cache_content_fields]&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;DELIMS = " "&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;FIELDS = "TimeStamp", "Operation", "Priority", "URL"&lt;/CODE&gt;
&lt;/P&gt;&lt;HR /&gt;
Given this example, the fields are extracted as follows (visible in the field picker):&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;TimeStamp&lt;/CODE&gt; = &lt;CODE&gt;1281654000.385657&lt;/CODE&gt; (yep that's fine)&lt;BR /&gt;
&lt;CODE&gt;Operation&lt;/CODE&gt;... Doesn't show up in list of available fields (default behavior with zero value?)&lt;BR /&gt;
&lt;CODE&gt;Priority&lt;/CODE&gt; = &lt;CODE&gt;refreshed&lt;/CODE&gt;&lt;BR /&gt;
&lt;CODE&gt;URL&lt;/CODE&gt; = &lt;CODE&gt;0.7850&lt;/CODE&gt;&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;I've checked for special characters (eg. tabs) in vi and there are none, so it looks as though the number of spaces is the issue, with nothing being allocated to the &lt;CODE&gt;Operation&lt;/CODE&gt; field, and this throwing the subsequent extractions out.&lt;/P&gt;

&lt;P&gt;The transforms.conf doco doesn't cover off the use of REGEX's in the DELIM statement, so I'm wondering what I can do here.&lt;/P&gt;

&lt;P&gt;As always, any help would be greatly appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2011 11:26:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inconsistent-number-of-spaces-in-a-space-delimited-event/m-p/57621#M14054</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2011-03-11T11:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent number of spaces in a space-delimited event.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inconsistent-number-of-spaces-in-a-space-delimited-event/m-p/57622#M14055</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;

&lt;P&gt;I think it doesn't work because there are multi spaces between "TimeStamp" and "Operation".&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;So, try this one.&lt;/P&gt;

&lt;P&gt;In props.conf:&lt;/P&gt;

&lt;PRE&gt;
[cache_content_fields]
REGEX = ^([^\s]+)\s+([^\s]+)\s([^\s]+)\s(.*)$
FORMAT = TimeStamp::"$1" Operation::"$2" Priority::"$3" URL::"$4"
&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Mar 2011 12:37:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inconsistent-number-of-spaces-in-a-space-delimited-event/m-p/57622#M14055</guid>
      <dc:creator>Hajime</dc:creator>
      <dc:date>2011-03-11T12:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent number of spaces in a space-delimited event.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inconsistent-number-of-spaces-in-a-space-delimited-event/m-p/57623#M14056</link>
      <description>&lt;P&gt;Your REGEX-fu is stronger than my REGEX-fu! Thanks so much &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2011 13:46:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inconsistent-number-of-spaces-in-a-space-delimited-event/m-p/57623#M14056</guid>
      <dc:creator>rturk</dc:creator>
      <dc:date>2011-03-11T13:46:13Z</dc:date>
    </item>
  </channel>
</rss>

