<?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: Distinguish between space and tab - REGEX in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99125#M25596</link>
    <description>&lt;P&gt;You can just put the first 64 in the FIELDS section, it should still pick them up correctly. But it won't really slow it down noticeably by extracting 64 fields. I have many many more fields than that and it works great. I think it's more expensive to use a regex than the FIELDS modifier.&lt;/P&gt;</description>
    <pubDate>Thu, 18 Jul 2013 11:07:12 GMT</pubDate>
    <dc:creator>alacercogitatus</dc:creator>
    <dc:date>2013-07-18T11:07:12Z</dc:date>
    <item>
      <title>Distinguish between space and tab - REGEX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99118#M25589</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;

&lt;P&gt;I'm trying to build a regex to extract n-field in a log. Each field of the log is separated by a tab, but it's possible to find spaces (any kind of string or phrases) inside them, here an example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;aaaaa, AD.cr(tab)2000-01-01 00:00:00(tab)12345/678-9(tab)987,654:321(tab)1(tab)2(tab)abcdefg123; asdoi(tab)...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There's a way to distinguish between a tab and a space or &lt;CODE&gt;\s&lt;/CODE&gt; comprehend also tabs?&lt;BR /&gt;
Supposing to need 6th field, this doesn't work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;([a-zA-Z0-9,/:.-;=]+\s?\t){6}(?&amp;lt;field&amp;gt;[\w-:\s]+)\t
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;`aaaaa, AD.cr` 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;abcdefg123; asdoi
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;have to be two field.&lt;BR /&gt;
Actually I have more than 100 field and I would like to extract 64th.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 10:46:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99118#M25589</guid>
      <dc:creator>emaccaferri</dc:creator>
      <dc:date>2013-07-18T10:46:30Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguish between space and tab - REGEX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99119#M25590</link>
      <description>&lt;P&gt;Usually in the line some field are empty, this means that there are a lot of tab one after the other&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 10:50:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99119#M25590</guid>
      <dc:creator>emaccaferri</dc:creator>
      <dc:date>2013-07-18T10:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguish between space and tab - REGEX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99120#M25591</link>
      <description>&lt;P&gt;&lt;CODE&gt;\s&lt;/CODE&gt; matches whitespace, which includes both regular spaces and tabs.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 10:55:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99120#M25591</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-07-18T10:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguish between space and tab - REGEX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99121#M25592</link>
      <description>&lt;P&gt;If you are certain there are no other tabs in the data, you can use a props/transforms to parse without regex.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;props.conf&lt;BR /&gt;
[my_sourcetype]&lt;BR /&gt;
REPORT-do = extract_csv_fields_sourcetype&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;transforms.conf&lt;BR /&gt;
[extract_csv_fields_sourcetype]&lt;BR /&gt;
DELIMS = "\t"&lt;BR /&gt;
FIELDS = field1, field2, field3, ... field100&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/admin/propsconf" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/admin/propsconf&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/admin/transformsconf" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/latest/admin/transformsconf&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 10:58:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99121#M25592</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-07-18T10:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguish between space and tab - REGEX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99122#M25593</link>
      <description>&lt;P&gt;Ok thanks, there is a way to match only one of the two?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 11:02:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99122#M25593</guid>
      <dc:creator>emaccaferri</dc:creator>
      <dc:date>2013-07-18T11:02:32Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguish between space and tab - REGEX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99123#M25594</link>
      <description>&lt;P&gt;If I use this method I have to extract all the 100 fields, even if I don't nedd them, right?&lt;BR /&gt;
It would be not so efficient&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 11:04:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99123#M25594</guid>
      <dc:creator>emaccaferri</dc:creator>
      <dc:date>2013-07-18T11:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguish between space and tab - REGEX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99124#M25595</link>
      <description>&lt;P&gt;Sure. '&lt;CODE&gt;\t&lt;/CODE&gt;' for tab, and simply &lt;CODE&gt;' '&lt;/CODE&gt; for space.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 11:05:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99124#M25595</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-07-18T11:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Distinguish between space and tab - REGEX</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99125#M25596</link>
      <description>&lt;P&gt;You can just put the first 64 in the FIELDS section, it should still pick them up correctly. But it won't really slow it down noticeably by extracting 64 fields. I have many many more fields than that and it works great. I think it's more expensive to use a regex than the FIELDS modifier.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 11:07:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Distinguish-between-space-and-tab-REGEX/m-p/99125#M25596</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-07-18T11:07:12Z</dc:date>
    </item>
  </channel>
</rss>

