<?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: Parsing at search time variable white spaces in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Parsing-at-search-time-variable-white-spaces/m-p/211886#M176635</link>
    <description>&lt;P&gt;You said a specific rex worked in the GUI. Did you try that same (as-is) regex in the props/transforms?&lt;/P&gt;</description>
    <pubDate>Fri, 23 Sep 2016 17:11:11 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-09-23T17:11:11Z</dc:date>
    <item>
      <title>Parsing at search time variable white spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Parsing-at-search-time-variable-white-spaces/m-p/211885#M176634</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I am new in Splunk parsing and I am facing some problems with this.&lt;BR /&gt;
I am trying to parse, at Search Time, a source of logs (containing two sourcetypes, AIX and Linux). In the AIX sourcetype, I have three different type of events (one for "PROC_Execute", another for  "CRON" and the last one for "S_PASSWD_READ".  The beginning of the event is the same for the three types.&lt;/P&gt;

&lt;P&gt;I have a UF -&amp;gt; IDX environment -&amp;gt; SH.&lt;/P&gt;

&lt;P&gt;I have tried many many things with transforms.conf and/or props.conf without any success.  Everytime I search for the sourcetype events, nothing is parsed in SH Gui.&lt;/P&gt;

&lt;P&gt;My logs look like this, for AIX (sourcetype=aix) (I will do linux afterwards.)&lt;/P&gt;

&lt;P&gt;PROC_Execute    root     OK          Mon Jul 25 10:53:26 2016 uncompress                      14614680 21364880 root&lt;BR /&gt;&lt;BR /&gt;
        euid: 0 egid: 0 epriv: ffffffff:ffffffff name /usr/bin/uncompress -f /audit/tempfile.21364880 &lt;BR /&gt;
PROC_Execute    i51534a  OK          Mon Jul 25 10:53:26 2016 sh                              15335586 7798934  root&lt;BR /&gt;&lt;BR /&gt;
        euid: 0 egid: 0 epriv: ffffffff:ffffffff name sh -c LANG=C /usr/bin/vmstat &lt;BR /&gt;
S_PASSWD_READ   root     OK          Mon Jul 25 10:54:00 2016 cron                            21233890 6684896  root&lt;BR /&gt;&lt;BR /&gt;
        audit object read event detected /etc/security/passwd&lt;BR /&gt;
S_PASSWD_READ   root     OK          Mon Jul 25 10:54:00 2016 cron                            21233890 6684896  root&lt;BR /&gt;&lt;BR /&gt;
        audit object read event detected /etc/security/passwd&lt;BR /&gt;
CRON_Start      root     OK          Mon Jul 25 10:54:00 2016 cron                            21233890 6684896  root&lt;BR /&gt;&lt;BR /&gt;
        event = start cron job cmd = &amp;gt; /lpar2rrd/product/logs/error.log  time = Mon Jul 25 10:54:00 2016&lt;/P&gt;

&lt;P&gt;As you can see, multiple white spaces is used as delimiter and more than that, the amount of white spaces between the "sh"/"uncompress" and the "process_number" can vary.&lt;/P&gt;

&lt;P&gt;I tried the following in the SH gui and it works fine. The events are parsed with correct values : &lt;BR /&gt;
"index= host= | rex field=_raw "^(?P\w+)\s+(?P\w+)\s+(?P\w+)\s+(?P\w+\s+\w+\s+\d+\s+\d+:\d+:\d+\s+\d+)\s+(?P[^ ]+)\s+(?P\d+)\s+(?P\d+)\s+(?P\w+)\s+(?P.*)$""&lt;/P&gt;

&lt;P&gt;In transforms.conf and/or props.congf, I tried using (?x) for free-spacing mode as the numbers of free spaces between "trail_aix_short_command" and "trail_aix_parent_process_id" can vary.&lt;BR /&gt;
I tried to put in props.conf, only the first extract "EXTRACT-aix_command = ^(?P[^ ]+)" (created with the fiedls extractor) without success. -&amp;gt; no parsing at search time in SR GUI.&lt;/P&gt;

&lt;P&gt;I tried, in transforms.conf, the following &lt;BR /&gt;
"(?x)(?P\w+)\s+(?P\w+)\s+(?P\w+)\s+(?P\w+\s+\w+\s+\d+\s+\d+:\d+:\d+\s+\d+)\s+(?P[^ ]+)\s+(?P\d+)\s+(?P\d+)\s+(?P\w+)\s+(?P.&lt;EM&gt;)" &lt;BR /&gt;
(with and without ")  and &lt;BR /&gt;
"(?P\w+)\s+(?P\w+)\s+(?P\w+)\s+(?P\w+\s+\w+\s+\d+\s+\d+:\d+:\d+\s+\d+)\s+(?P[^ ]+)\s+(?P\d+)\s+(?P\d+)\s+(?P\w+)\s+(?P.&lt;/EM&gt;)" &lt;BR /&gt;
(with and without ") &lt;BR /&gt;
without success.&lt;/P&gt;

&lt;P&gt;I tried also with (.*) for each element in transforms.conf without success.&lt;/P&gt;

&lt;P&gt;=&amp;gt; I need some help.&lt;/P&gt;

&lt;P&gt;What I would like to do is parse until the "user name" in a common extraction, and then use three other extractions, one for "CRON", one for "PASSWD" and one for "PROC_EXECUTE" =&amp;gt; can you help?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:08:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Parsing-at-search-time-variable-white-spaces/m-p/211885#M176634</guid>
      <dc:creator>FrancoiseMathy</dc:creator>
      <dc:date>2020-09-29T11:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing at search time variable white spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Parsing-at-search-time-variable-white-spaces/m-p/211886#M176635</link>
      <description>&lt;P&gt;You said a specific rex worked in the GUI. Did you try that same (as-is) regex in the props/transforms?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2016 17:11:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Parsing-at-search-time-variable-white-spaces/m-p/211886#M176635</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-09-23T17:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Parsing at search time variable white spaces</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Parsing-at-search-time-variable-white-spaces/m-p/211887#M176636</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;Yes I haved tried what you suggested : &lt;BR /&gt;
In GUI,  I put "index=trailsyslog host = | rex field=_raw "^(?P\w+)\s+(?P\w+)\s+(?P\w+)\s+(?P\w+\s+\w+\s+\d+\s+\d+:\d+:\d+\s+\d+)\s+(?P[^ ]+)\s+(?P\d+)\s+(?P\d+)\s+(?P\w+)\s+(?P.*)$"&lt;BR /&gt;
=&amp;gt; this is ok. The events are parsed and different fields (trail_aix_status, trail_aix; time, ...) are present in the GUI.&lt;/P&gt;

&lt;P&gt;Then, &lt;BR /&gt;
In transforms, I put &lt;BR /&gt;
[aix_common_fields]&lt;BR /&gt;
REGEX = ^(?P\w+)\s+(?P\w+)\s+(?P\w+)\s+(?P\w+\s+\w+\s+\d+\s+\d+:\d+:\d+\s+\d+)\s+(?P[^ ]+)\s+(?P\d+)\s+(?P\d+)\s+(?P\w+)\s+(?P.*)$&lt;/P&gt;

&lt;P&gt;In props, I put&lt;BR /&gt;
[trailsyslog-aix]&lt;BR /&gt;
REPORT-aix_common_fields = aix_common_fields&lt;BR /&gt;
.&lt;BR /&gt;
FYI, trailsyslog-aix is my sourcetype&lt;/P&gt;

&lt;P&gt;=&amp;gt; I did a  "splunk reload deploy-server"&lt;BR /&gt;
=&amp;gt; I did the search  "index=trailsyslog host =  =&amp;gt; nothing is parsed. The fields are not present.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:10:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Parsing-at-search-time-variable-white-spaces/m-p/211887#M176636</guid>
      <dc:creator>FrancoiseMathy</dc:creator>
      <dc:date>2020-09-29T11:10:32Z</dc:date>
    </item>
  </channel>
</rss>

