<?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: define and search on space delimited fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/define-and-search-on-space-delimited-fields/m-p/154282#M43391</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;This might be because you've included the whitespace character in your fields. Try  your search with this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=MouseTracker | rex "\s(?&amp;lt;Xpsn&amp;gt;\d+)\s(?&amp;lt;Ypsn&amp;gt;\d+)\s(?&amp;lt;prime&amp;gt;\w+)\s(?&amp;lt;\sub&amp;gt;\w+)" |search prime="hand" |table prime sub
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or alternatively you could search for prime=" hand" which is probably not what you want to do.&lt;/P&gt;</description>
    <pubDate>Sun, 24 Nov 2013 19:23:10 GMT</pubDate>
    <dc:creator>chris</dc:creator>
    <dc:date>2013-11-24T19:23:10Z</dc:date>
    <item>
      <title>define and search on space delimited fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/define-and-search-on-space-delimited-fields/m-p/154281#M43390</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have the following data:  (time x y  word1 word2 )&lt;/P&gt;

&lt;P&gt;20131116-162406.698 569 609 burbled his &lt;BR /&gt;&lt;BR /&gt;
20131116-162407.590 568 615 wood manxsome &lt;BR /&gt;&lt;BR /&gt;
20131116-162408.481 684 592 tumtum raths &lt;BR /&gt;&lt;BR /&gt;
20131116-162409.372 635 609 head his &lt;BR /&gt;&lt;BR /&gt;
20131116-162410.263 882 620 with tumtum &lt;BR /&gt;&lt;BR /&gt;
20131116-162411.154 489 608 sought took &lt;BR /&gt;&lt;BR /&gt;
20131116-162412.045 484 624 hand thought &lt;BR /&gt;&lt;BR /&gt;
20131116-162412.936 484 624 hand thought &lt;BR /&gt;&lt;BR /&gt;
20131116-162413.827 917 613 son long &lt;BR /&gt;&lt;BR /&gt;
20131116-162414.718 1162 552 wabe foe &lt;BR /&gt;&lt;BR /&gt;
20131116-162415.609 145 552 hand foe &lt;BR /&gt;&lt;BR /&gt;
20131116-162416.500 956 587 galumphing hand &lt;BR /&gt;&lt;BR /&gt;
20131116-162417.391 628 635 aflame head &lt;BR /&gt;&lt;BR /&gt;
...etc&lt;/P&gt;

&lt;P&gt;splunk recognises the timestamp field but nothing else, so i am trying to identify the remaining fields, at search time,  as   Xpsn  Ypsn   prime  sub&lt;/P&gt;

&lt;P&gt;(nb. in the following regex epressions the '\' after each '(?&amp;lt;' is added to get this edit window to display properly and not in the splunk search line).&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;This works:&lt;BR /&gt;&lt;BR /&gt;
sourcetype=MouseTracker  | rex (?&amp;lt;\Xpsn&amp;gt;\s\d+)+(?&amp;lt;\Ypsn&amp;gt;\s\d+)+(?&amp;lt;\prime&amp;gt;\s\w+)+(?&amp;lt;\sub&amp;gt;\s\w+) |top prime&lt;/P&gt;

&lt;P&gt;This also works:&lt;BR /&gt;&lt;BR /&gt;
sourcetype=MouseTracker  | rex (?&amp;lt;\Xpsn&amp;gt;\s\d+)+(?&amp;lt;\Ypsn&amp;gt;\s\d+)+(?&amp;lt;\prime&amp;gt;\s\w+)+(?&amp;lt;\sub&amp;gt;\s\w+) |table prime sub Xspn&lt;/P&gt;

&lt;P&gt;However this does not work:&lt;BR /&gt;&lt;BR /&gt;
sourcetype=MouseTracker  | rex (?&amp;lt;\Xpsn&amp;gt;\s\d+)+(?&amp;lt;\Ypsn&amp;gt;\s\d+)+(?&amp;lt;\prime&amp;gt;\s\w+)+(?&amp;lt;\sub&amp;gt;\s\w+) |search prime=hand |table prime sub &lt;/P&gt;

&lt;P&gt;why?  why cant  search use the new fields when top, filter, table and others can??&lt;/P&gt;

&lt;P&gt;This is not suitable:&lt;BR /&gt;&lt;BR /&gt;
sourcetype=MouseTracker  hand | rex ... (etc)  because it hits if 'hand'  is first or second word.&lt;/P&gt;

&lt;P&gt;sorry to be a ghastly newbie but this has me stumped.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2013 11:18:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/define-and-search-on-space-delimited-fields/m-p/154281#M43390</guid>
      <dc:creator>TimInSplunkAcc</dc:creator>
      <dc:date>2013-11-24T11:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: define and search on space delimited fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/define-and-search-on-space-delimited-fields/m-p/154282#M43391</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;This might be because you've included the whitespace character in your fields. Try  your search with this regex:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=MouseTracker | rex "\s(?&amp;lt;Xpsn&amp;gt;\d+)\s(?&amp;lt;Ypsn&amp;gt;\d+)\s(?&amp;lt;prime&amp;gt;\w+)\s(?&amp;lt;\sub&amp;gt;\w+)" |search prime="hand" |table prime sub
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or alternatively you could search for prime=" hand" which is probably not what you want to do.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Nov 2013 19:23:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/define-and-search-on-space-delimited-fields/m-p/154282#M43391</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2013-11-24T19:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: define and search on space delimited fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/define-and-search-on-space-delimited-fields/m-p/154283#M43392</link>
      <description>&lt;P&gt;thanks very much.  That has sorted it.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2013 18:13:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/define-and-search-on-space-delimited-fields/m-p/154283#M43392</guid>
      <dc:creator>TimInSplunkAcc</dc:creator>
      <dc:date>2013-11-25T18:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: define and search on space delimited fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/define-and-search-on-space-delimited-fields/m-p/154284#M43393</link>
      <description>&lt;P&gt;You're welcome&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2013 08:40:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/define-and-search-on-space-delimited-fields/m-p/154284#M43393</guid>
      <dc:creator>chris</dc:creator>
      <dc:date>2013-11-26T08:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: define and search on space delimited fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/define-and-search-on-space-delimited-fields/m-p/154285#M43394</link>
      <description>&lt;P&gt;And to make it 'permanent', i.e. moving it from the query to a config file;&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
    [MouseTracker]&lt;BR /&gt;
    REPORT-blah = mouse_tracker_extractions&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;BR /&gt;
    [mouse_tracker_extractions]&lt;BR /&gt;
    DELIMS = " "&lt;BR /&gt;
    FIELDS = timestamp, Xpsn, Ypsn, prime, sub&lt;/P&gt;

&lt;P&gt;/k&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:22:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/define-and-search-on-space-delimited-fields/m-p/154285#M43394</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2020-09-28T15:22:03Z</dc:date>
    </item>
  </channel>
</rss>

