<?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 do I fix my field extraction to account for whitespace in some paths in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-fix-my-field-extraction-to-account-for-whitespace-in/m-p/582219#M202808</link>
    <description>&lt;P&gt;If you want to get the key with an empty value, use "KEEP_EMPTY_VALS = true" in your extraction stanza in transforms.conf.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jan 2022 09:10:33 GMT</pubDate>
    <dc:creator>_Tom</dc:creator>
    <dc:date>2022-01-24T09:10:33Z</dc:date>
    <item>
      <title>How do I fix my field extraction to account for whitespace in some paths</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-fix-my-field-extraction-to-account-for-whitespace-in/m-p/473825#M133323</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;I have some data in a txt file that I am working on extractions for. It extracts fine except that in some of the urls there is/are spaces and it throws the rest of the extractions off.&lt;/P&gt;

&lt;P&gt;for example&lt;BR /&gt;
this works just fine&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Type      AppliesTo  Path                                            Snap  Hard    Soft  Adv     Used    
---------------------------------------------------------------------------------------------------------
directory DEFAULT    /place/here2/test                                  No    1.00G   -     990.00M 12      
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However this does not&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Type      AppliesTo  Path                                            Snap  Hard    Soft  Adv     Used    
---------------------------------------------------------------------------------------------------------

directory DEFAULT    /place/here/fileservers/host16/App Management No    100.00G -     98.00G  90.073G 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;due to spaces in the path the extarctions after that dont work.&lt;/P&gt;

&lt;P&gt;Here are my props&lt;/P&gt;

&lt;P&gt;[ storage:data ]&lt;BR /&gt;
CHARSET=UTF-8&lt;BR /&gt;
DATETIME_CONFIG=CURRENT&lt;BR /&gt;
FIELD_DELIMITER=whitespace&lt;BR /&gt;
HEADER_FIELD_LINE_NUMBER=1&lt;BR /&gt;
LINE_BREAKER=([\r\n]+)&lt;BR /&gt;
NO_BINARY_CHECK=null&lt;BR /&gt;
SEDCMD-removeDash=s/---------------------------------------------------------------------------------------------------------//g&lt;BR /&gt;
SEDCMD-removeDash2=s/^-.*$//g&lt;BR /&gt;
SHOULD_LINEMERGE=false&lt;BR /&gt;
disabled=false&lt;BR /&gt;
pulldown_type=true&lt;/P&gt;

&lt;P&gt;The issue is using whitespace as the delimiter I suppose but if I dont use that I dont get any field extractions. Any ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:58:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-fix-my-field-extraction-to-account-for-whitespace-in/m-p/473825#M133323</guid>
      <dc:creator>tkw03</dc:creator>
      <dc:date>2020-09-30T04:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fix my field extraction to account for whitespace in some paths</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-fix-my-field-extraction-to-account-for-whitespace-in/m-p/473826#M133324</link>
      <description>&lt;P&gt;Give the below a shot. You'll need to check the line breaking (LINE_BREAKER) to verify the events are broken properly. And you'll need to list all possible values of the 'Type' field separated by a pipe in the regular expression (EXTRACT). I've listed 'directory' and 'file'. This should give you the correct search-time field extractions.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[storage:data]
CHARSET=UTF-8
DATETIME_CONFIG=CURRENT
LINE_BREAKER=([\r\n]+) *Type +
NO_BINARY_CHECK=null
SHOULD_LINEMERGE=false
disabled=false
pulldown_type=true
EXTRACT-data=^ *(?&amp;lt;Type&amp;gt;directory|file) +(?&amp;lt;AppliesTo&amp;gt;[^ ]+) +(?&amp;lt;Path&amp;gt;.+) +(?&amp;lt;Snap&amp;gt;[^ ]+) +(?&amp;lt;Hard&amp;gt;[^ ]+) +(?&amp;lt;Soft&amp;gt;[^ ]+) +(?&amp;lt;Adv&amp;gt;[^ ]+) +(?&amp;lt;Used&amp;gt;[^ ]+) *$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;For a clustered environment:&lt;/P&gt;

&lt;P&gt;props.conf on indexers:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [storage:data]
 CHARSET=UTF-8
 DATETIME_CONFIG=CURRENT
 LINE_BREAKER=([\r\n]+) *Type +
 NO_BINARY_CHECK=null
 SHOULD_LINEMERGE=false
 disabled=false
 pulldown_type=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf on search heads:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[storage:data]
EXTRACT-data=^ *(?&amp;lt;Type&amp;gt;directory|file) +(?&amp;lt;AppliesTo&amp;gt;[^ ]+) +(?&amp;lt;Path&amp;gt;.+) +(?&amp;lt;Snap&amp;gt;[^ ]+) +(?&amp;lt;Hard&amp;gt;[^ ]+) +(?&amp;lt;Soft&amp;gt;[^ ]+) +(?&amp;lt;Adv&amp;gt;[^ ]+) +(?&amp;lt;Used&amp;gt;[^ ]+) *$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Apr 2020 14:36:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-fix-my-field-extraction-to-account-for-whitespace-in/m-p/473826#M133324</guid>
      <dc:creator>atownson</dc:creator>
      <dc:date>2020-04-08T14:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fix my field extraction to account for whitespace in some paths</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-fix-my-field-extraction-to-account-for-whitespace-in/m-p/473827#M133325</link>
      <description>&lt;P&gt;Question, if a field in the log record doesnt exist is there a way to force that field to extract nothing? be blank? &lt;/P&gt;

&lt;P&gt;Sometimes I have a  record like this:&lt;BR /&gt;
    directory DEFAULT    /ifs/home/home/T/TLO11                                          No    1.00G                12&lt;/P&gt;

&lt;P&gt;Ans sometimes its like this:&lt;BR /&gt;
    directory DEFAULT    /ifs/home/departments/o56/Dev                             No    1.00G         921.60M 2.55M&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2020 19:26:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-fix-my-field-extraction-to-account-for-whitespace-in/m-p/473827#M133325</guid>
      <dc:creator>tkw03</dc:creator>
      <dc:date>2020-04-28T19:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I fix my field extraction to account for whitespace in some paths</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-fix-my-field-extraction-to-account-for-whitespace-in/m-p/582219#M202808</link>
      <description>&lt;P&gt;If you want to get the key with an empty value, use "KEEP_EMPTY_VALS = true" in your extraction stanza in transforms.conf.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 09:10:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-fix-my-field-extraction-to-account-for-whitespace-in/m-p/582219#M202808</guid>
      <dc:creator>_Tom</dc:creator>
      <dc:date>2022-01-24T09:10:33Z</dc:date>
    </item>
  </channel>
</rss>

