<?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: SOURCE_KEY &amp; multiple fields issue in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191909#M55223</link>
    <description>&lt;P&gt;There are a couple of things going on here. &lt;BR /&gt;
First, the BREAK_ONLY_BEFORE directive receives a regex. So if you tried your ***\s in some thing like regexr.com it would tell you "nothing to repeat" what you want there is: &lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
BREAK_ONLY_BEFORE= (*){3}\s&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
If you're testing with the data above... it just writes a complaint to the log and dumps the whole thing out as a multiline event... so you might not notice&lt;/P&gt;

&lt;P&gt;You say above: "I need to extract multi-value fields (shown as FRAG's below)"&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;And your first transforms does just that:&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[foo-FRAG]&lt;BR /&gt;
REGEX      = (FRAG) ([^\r\n]+)&lt;BR /&gt;
FORMAT     = $1::$2&lt;BR /&gt;
MV_ADD     = true&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
MV_ADD in this case is actually going to make a multivalue field out of FRAG&lt;BR /&gt;&lt;BR /&gt;
"If set to true, the extractor makes the field a multivalued field and appends the &lt;BR /&gt;
newly found value, otherwise the newly found value is discarded."&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://i1368.photobucket.com/albums/ag181/RxSennett/FRAG_zps5fd8b415.jpg" /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;So FRAG is a multivalue field... &lt;/P&gt;

&lt;P&gt;you can see that if you do this in the search bar&lt;BR /&gt;
&lt;CODE&gt;eval n=mvcount(FRAG) | table FRAG n&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;But I suspect what you might want is what's INSIDE FRAG to be the multivalue field So that would happen only if FRAG was the event (SHOULD_LINEMERGE=false)&lt;BR /&gt;
What you're probably seeing now, is that FRAG is extracted as a multivalue field and the first five values, of the first instance of the FRAG field, separated by a space, are deposited into field's called field1, field2, field3, field4 &amp;amp; field5&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;First... I see more than 5 fields... and it's unclear what you actually want in the fields other than the first five values of FRAG. &lt;/P&gt;

&lt;P&gt;This answer... isn't really an answer, but the comments wouldn't hold all this. &lt;/P&gt;

&lt;P&gt;you could use multikv.conf to be really specific about how you want to break this up but probably it would be easier to break things up within your search &lt;/P&gt;

&lt;P&gt;Give us a visual example of what you want to end up with (be less foo/bar about it) and we'll edit the answer so others can benefit.&lt;/P&gt;</description>
    <pubDate>Sat, 07 Jun 2014 17:12:54 GMT</pubDate>
    <dc:creator>rsennett_splunk</dc:creator>
    <dc:date>2014-06-07T17:12:54Z</dc:date>
    <item>
      <title>SOURCE_KEY &amp; multiple fields issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191908#M55222</link>
      <description>&lt;P&gt;Hi Everyone,&lt;BR /&gt;
I have encountered an issue with SOURCE_KEY and MV_ADD&lt;BR /&gt;
I need to extract multi-value fields (shown as FRAG's below)&lt;BR /&gt;
the event looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;*** 10 0 8 30 *NULL* foo 2 1 13671237459 11 1392550059 0 0 128928 4 3 3 0 bar *NULL* *NULL* 0 1 0 0 0 *NULL* 1 0 0 0 0 0 0 *NULL* 0 0 0 *NULL* 1607660 2 0 1440 0 0 1 1 0 1 0 *NULL* *NULL* 
FRAG 1 1 121238 0 0 0 0 1 2 457210 0 0 -1 0 3 0 0 6 1368450059 1234240476 0 *NULL* *NONE* 
FRAG 1 1 121258 0 0 0 0 1 2 187351 0 0 -1 0 3 0 0 6 1328450059 6235240476 0 *NULL* *NONE* 
FRAG 1 1 128518 0 0 0 0 1 2 262144 0 0 -1 0 3 0 0 6 1362410859 1233240476 0 *NULL* *NONE* 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my Props.conf looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[foo] 
BREAK_ONLY_BEFORE = ***\s
MAX_TIMESTAMP_LOOKAHEAD = 150
NO_BINARY_CHECK = 1 pulldown_type = 1
REPORT-foo-a = foo-FRAG, foo-FRAG-fields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my transforms.conf looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[foo-FRAG]
SOURCE_KEY = _raw
REGEX      = (FRAG) ([^\r\n]+)
FORMAT     = $1::$2
MV_ADD     = true

[foo-FRAG-fields]
SOURCE_KEY = FRAG
DELIMS     = " "
FIELDS     = "field1","field2","field3","field4","field5"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now the issue is, that the system recognizes the fields but does not treat them as multi-value fields.&lt;BR /&gt;
Is there any resolution for this issue?&lt;/P&gt;

&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:48:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191908#M55222</guid>
      <dc:creator>NaorPenso</dc:creator>
      <dc:date>2020-09-28T16:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: SOURCE_KEY &amp; multiple fields issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191909#M55223</link>
      <description>&lt;P&gt;There are a couple of things going on here. &lt;BR /&gt;
First, the BREAK_ONLY_BEFORE directive receives a regex. So if you tried your ***\s in some thing like regexr.com it would tell you "nothing to repeat" what you want there is: &lt;BR /&gt;&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
BREAK_ONLY_BEFORE= (*){3}\s&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;BR /&gt;
If you're testing with the data above... it just writes a complaint to the log and dumps the whole thing out as a multiline event... so you might not notice&lt;/P&gt;

&lt;P&gt;You say above: "I need to extract multi-value fields (shown as FRAG's below)"&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;And your first transforms does just that:&lt;BR /&gt;
&lt;CODE&gt;&lt;BR /&gt;
[foo-FRAG]&lt;BR /&gt;
REGEX      = (FRAG) ([^\r\n]+)&lt;BR /&gt;
FORMAT     = $1::$2&lt;BR /&gt;
MV_ADD     = true&lt;BR /&gt;
&lt;/CODE&gt;&lt;BR /&gt;
MV_ADD in this case is actually going to make a multivalue field out of FRAG&lt;BR /&gt;&lt;BR /&gt;
"If set to true, the extractor makes the field a multivalued field and appends the &lt;BR /&gt;
newly found value, otherwise the newly found value is discarded."&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://i1368.photobucket.com/albums/ag181/RxSennett/FRAG_zps5fd8b415.jpg" /&gt;&lt;BR /&gt;
&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;So FRAG is a multivalue field... &lt;/P&gt;

&lt;P&gt;you can see that if you do this in the search bar&lt;BR /&gt;
&lt;CODE&gt;eval n=mvcount(FRAG) | table FRAG n&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;But I suspect what you might want is what's INSIDE FRAG to be the multivalue field So that would happen only if FRAG was the event (SHOULD_LINEMERGE=false)&lt;BR /&gt;
What you're probably seeing now, is that FRAG is extracted as a multivalue field and the first five values, of the first instance of the FRAG field, separated by a space, are deposited into field's called field1, field2, field3, field4 &amp;amp; field5&lt;BR /&gt;&lt;/P&gt;

&lt;P&gt;First... I see more than 5 fields... and it's unclear what you actually want in the fields other than the first five values of FRAG. &lt;/P&gt;

&lt;P&gt;This answer... isn't really an answer, but the comments wouldn't hold all this. &lt;/P&gt;

&lt;P&gt;you could use multikv.conf to be really specific about how you want to break this up but probably it would be easier to break things up within your search &lt;/P&gt;

&lt;P&gt;Give us a visual example of what you want to end up with (be less foo/bar about it) and we'll edit the answer so others can benefit.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jun 2014 17:12:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191909#M55223</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2014-06-07T17:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: SOURCE_KEY &amp; multiple fields issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191910#M55224</link>
      <description>&lt;P&gt;Hi rsennett,&lt;BR /&gt;
Thanks a lot!&lt;BR /&gt;
allow me to elaborate a bit without exposing sensitive data.&lt;/P&gt;

&lt;P&gt;I am trying to analyze backup logs, each log contains the main event (aka ***) and within the event, fragments of the backup, where were they written to, how much was written etc.&lt;/P&gt;

&lt;P&gt;as you suggested, FRAG doesn't matter, what's within is important. there are more than 5 fields, but as i just put 5 fields instead of 27 which is the correct amount of fields.&lt;/P&gt;

&lt;P&gt;here is a picture of the results for "eval n=mvcount(FRAG) | table FRAG n"&lt;BR /&gt;
&lt;IMG src="http://i.imgur.com/zbf0F4T.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jun 2014 17:33:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191910#M55224</guid>
      <dc:creator>NaorPenso</dc:creator>
      <dc:date>2014-06-07T17:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: SOURCE_KEY &amp; multiple fields issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191911#M55225</link>
      <description>&lt;P&gt;One critical question and then I may have a suggestion for you. The "header" (the line prefixed with ***) has a timestamp (in epoch time). The FRAG lines also have what looks like a timestamp.&lt;/P&gt;

&lt;P&gt;Which one will you use?&lt;/P&gt;

&lt;P&gt;Also... we started this discussion about multivalue fields. However, in the end...  it looks like what you really want to do, is break up the FRAG lines into individual fields. Yes?&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jun 2014 17:32:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191911#M55225</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2014-06-08T17:32:09Z</dc:date>
    </item>
    <item>
      <title>Re: SOURCE_KEY &amp; multiple fields issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191912#M55226</link>
      <description>&lt;P&gt;Hi rsennett,&lt;BR /&gt;
The header has several EPOC timestamps (start, end) further down the event.&lt;BR /&gt;
The FRAG lines also has a time stamp, which may differ from the original time stamp, but the EPOC of the FRAG is less important to me.&lt;/P&gt;

&lt;P&gt;I will be using the EPOC time of the header for this instance.&lt;/P&gt;

&lt;P&gt;regarding the multivalue fields; I know that i can split the FRAG into different events but that will not be good as they must remain a part of the main event. mutlivalue is crucial to me as some of those values require mathematical manipulations (sum, avg etc.)&lt;/P&gt;

&lt;P&gt;Thanks again for all of the assistance!!&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2014 10:31:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191912#M55226</guid>
      <dc:creator>NaorPenso</dc:creator>
      <dc:date>2014-06-11T10:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: SOURCE_KEY &amp; multiple fields issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191913#M55227</link>
      <description>&lt;P&gt;Hi rsennett,&lt;BR /&gt;
Any insights? I'm still stuck on this subject &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Thanks in advance,&lt;BR /&gt;
Naor&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jun 2014 15:48:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/SOURCE-KEY-multiple-fields-issue/m-p/191913#M55227</guid>
      <dc:creator>NaorPenso</dc:creator>
      <dc:date>2014-06-23T15:48:53Z</dc:date>
    </item>
  </channel>
</rss>

