<?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 Extract variable number of fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-number-of-fields/m-p/78579#M19868</link>
    <description>&lt;P&gt;I have a Smarts Audit Log that I am trying to do a search time field extraction for. Most of the lines are fairly regularly formatted using tabs (\t) as a seperator.&lt;/P&gt;

&lt;P&gt;The problem I have is that while most of the lines have 8 fields, there are some that only have 5 and I'm not sure how to deal with that so they can all live happily in the same report. I've read a few of the suggested fixes but they seem to rely on there being a particular description field to tailor different regexes to different line formats. Mine just come up short if the fields aren't there.&lt;/P&gt;

&lt;P&gt;Any suggestions or pointers gratefully accepted.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Sep 2011 06:18:01 GMT</pubDate>
    <dc:creator>grist</dc:creator>
    <dc:date>2011-09-20T06:18:01Z</dc:date>
    <item>
      <title>Extract variable number of fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-number-of-fields/m-p/78579#M19868</link>
      <description>&lt;P&gt;I have a Smarts Audit Log that I am trying to do a search time field extraction for. Most of the lines are fairly regularly formatted using tabs (\t) as a seperator.&lt;/P&gt;

&lt;P&gt;The problem I have is that while most of the lines have 8 fields, there are some that only have 5 and I'm not sure how to deal with that so they can all live happily in the same report. I've read a few of the suggested fixes but they seem to rely on there being a particular description field to tailor different regexes to different line formats. Mine just come up short if the fields aren't there.&lt;/P&gt;

&lt;P&gt;Any suggestions or pointers gratefully accepted.  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2011 06:18:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-variable-number-of-fields/m-p/78579#M19868</guid>
      <dc:creator>grist</dc:creator>
      <dc:date>2011-09-20T06:18:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extract variable number of fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-number-of-fields/m-p/78580#M19869</link>
      <description>&lt;P&gt;if you could post an example of your log that would be helpful&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2011 06:21:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-variable-number-of-fields/m-p/78580#M19869</guid>
      <dc:creator>MarioM</dc:creator>
      <dc:date>2011-09-20T06:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extract variable number of fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-number-of-fields/m-p/78581#M19870</link>
      <description>&lt;P&gt;You can have multiple extractions occur against different types of events for a specific sourcetype.   This is not uncommon.  The key here is that you must find a way to differentiate the lines that only have 5 fields.   If it is formatted differently, that will be pretty straightforward.   If it is formatted with only delimiters, then you can create a regex that operates on 5 values instead of 8.   Posting a data sample will allow others to help further.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2011 20:11:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-variable-number-of-fields/m-p/78581#M19870</guid>
      <dc:creator>Simeon</dc:creator>
      <dc:date>2011-09-20T20:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Extract variable number of fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-variable-number-of-fields/m-p/78582#M19871</link>
      <description>&lt;P&gt;The only difference between the lines is the number of fields. They are all tab separated so it's pretty easy to split them with a regex.&lt;/P&gt;

&lt;P&gt;I'll have a go with 2 regexes. I'm thinking I need to so something like what's described in the first answer to &lt;A href="http://splunk-base.splunk.com/answers/23274/parsing-variable-fields-in-a-log-file"&gt;http://splunk-base.splunk.com/answers/23274/parsing-variable-fields-in-a-log-file&lt;/A&gt; but I'm not 100% on how to do it so all the results will show in the same search.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2011 00:41:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-variable-number-of-fields/m-p/78582#M19871</guid>
      <dc:creator>grist</dc:creator>
      <dc:date>2011-09-21T00:41:40Z</dc:date>
    </item>
  </channel>
</rss>

