<?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: Inconsistent Delimited Values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Inconsistent-Delimited-Values/m-p/277997#M83892</link>
    <description>&lt;P&gt;can you share an example of your logs?&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 06 Feb 2017 13:09:14 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2017-02-06T13:09:14Z</dc:date>
    <item>
      <title>Inconsistent Delimited Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inconsistent-Delimited-Values/m-p/277996#M83891</link>
      <description>&lt;P&gt;Here's my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; base search | rex "^(?&amp;lt;field1&amp;gt;[^:]+):\|:(?&amp;lt;field2&amp;gt;[^:]+):\|:(?&amp;lt;field3&amp;gt;[^:]+):\|:"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The logs are delimited by &lt;CODE&gt;:|:&lt;/CODE&gt; and this search about works fine but some events have inconsistent values with 6 or 9 or 12 fields but 97% of the logs have 3 fields only. This 6 or 9 or 12 fields are 2 or 3 or 4 events that appear in 1 line.&lt;/P&gt;

&lt;P&gt;Extraction should be done in search only.&lt;/P&gt;

&lt;P&gt;Anyone here encountered this kind of logs? &lt;/P&gt;

&lt;P&gt;Any input would be very much appreciated.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;

&lt;P&gt;EDIT:&lt;/P&gt;

&lt;P&gt;Sample Logs&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2/1/17
11:59:59.000 PM 
396629369  396629369:|:0:|:U:|:
2/1/17
11:59:59.000 PM 
665341651  665341651:|:0:|:U:|:
665341657  665341657:|:0:|:U:|:
665341660  665341660:|:0:|:E:|:
665341654  665341654:|:0:|:U:|:
2/1/17
11:59:59.000 PM 
396629369  396629368:|:0:|:U:|:
2/1/17
11:59:59.000 PM 
665341651  665341652:|:0:|:U:|:
665341657  665341653:|:0:|:U:|:
2/1/17
11:59:59.000 PM 
396629369  396629366:|:0:|:U:|:
2/1/17
11:59:59.000 PM 
396629369  396629367:|:0:|:U:|:
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Feb 2017 12:29:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inconsistent-Delimited-Values/m-p/277996#M83891</guid>
      <dc:creator>lloydknight</dc:creator>
      <dc:date>2017-02-06T12:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent Delimited Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inconsistent-Delimited-Values/m-p/277997#M83892</link>
      <description>&lt;P&gt;can you share an example of your logs?&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 13:09:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inconsistent-Delimited-Values/m-p/277997#M83892</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-02-06T13:09:14Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent Delimited Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inconsistent-Delimited-Values/m-p/277998#M83893</link>
      <description>&lt;P&gt;please see edit for the sample logs&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 13:21:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inconsistent-Delimited-Values/m-p/277998#M83893</guid>
      <dc:creator>lloydknight</dc:creator>
      <dc:date>2017-02-06T13:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Inconsistent Delimited Values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Inconsistent-Delimited-Values/m-p/277999#M83894</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;

&lt;P&gt;Already solved this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search | rex "^((?&amp;lt;field1&amp;gt;[^:]+):\|:(?&amp;lt;field2&amp;gt;[^:]+):\|:(?&amp;lt;field3&amp;gt;[^:]+):)?(\|:(?&amp;lt;field4&amp;gt;[^:]+):\|:(?&amp;lt;field5&amp;gt;[^:]+):\|:(?&amp;lt;field6&amp;gt;[^:]+):)?(\|:(?&amp;lt;field7&amp;gt;[^:]+):\|:(?&amp;lt;field8&amp;gt;[^:]+):\|:(?&amp;lt;field9&amp;gt;[^:]+):)?(\|:(?&amp;lt;field10&amp;gt;[^:]+):\|:(?&amp;lt;field11&amp;gt;[^:]+):\|:(?&amp;lt;field12&amp;gt;[^:]+):\|:)?"
| eval newfield1=mvappend(field1, field4, field7, field10)
| eval newfield2=mvappend(field2, field5, field8, field11)
| eval newfield3=mvappend(field3, field6, field9, field12)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Grouped them into 3 then used "?"&lt;BR /&gt;
and used mvappend for the newfield&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 14:32:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Inconsistent-Delimited-Values/m-p/277999#M83894</guid>
      <dc:creator>lloydknight</dc:creator>
      <dc:date>2017-02-06T14:32:22Z</dc:date>
    </item>
  </channel>
</rss>

