<?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: giving meaning to numbers in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34736#M7539</link>
    <description>&lt;P&gt;Why merge them? It seems from your uses / needs it would be best to index each line as an event?&lt;/P&gt;</description>
    <pubDate>Wed, 14 Dec 2011 12:39:00 GMT</pubDate>
    <dc:creator>Drainy</dc:creator>
    <dc:date>2011-12-14T12:39:00Z</dc:date>
    <item>
      <title>giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34725#M7528</link>
      <description>&lt;P&gt;I have a set of data from a friend who is doing some statistical work and he want me to use splunk to give meaning to his numbers.&lt;/P&gt;

&lt;P&gt;there's only this inside the data, coming in every second and the data can change but the format is the same.&lt;/P&gt;

&lt;P&gt;I had managed to pick out fields for the 1st line with a regex. but i wasn't as successful when i try to pick &lt;EM&gt;113601820946&lt;/EM&gt; from line &lt;EM&gt;37&lt;/EM&gt;. Can anyone help with writing a regex for this? i need to pick what ever that is in the square brackets behind it, which is &lt;EM&gt;113601820946&lt;/EM&gt; and needs to be dynamic cos it changes..&lt;/P&gt;

&lt;P&gt;09:15:29 [2]    [16]    [123456XXXXXX1234]&lt;BR /&gt;
09:15:29 [3]    [6]     [000000]&lt;BR /&gt;
09:15:29 [4]    [12]    [000000000594]&lt;BR /&gt;
09:15:29 [7]    [10]    [0516011527]&lt;BR /&gt;
09:15:29 [11]   [6]     [820946]&lt;BR /&gt;
09:15:29 [19]   [3]     [826]&lt;BR /&gt;
09:15:29 [25]   [2]     [59]&lt;BR /&gt;
09:15:29 [32]   [6]     [454706]&lt;BR /&gt;
09:15:29 [37]   [13]    [113601820946]&lt;BR /&gt;
09:15:29 [38]   [6]     [001767]&lt;BR /&gt;
09:15:29 [39]   [2]     [00]&lt;BR /&gt;
09:15:29 [41]   [8]     [04983408]&lt;BR /&gt;
09:15:29 [42]   [15]    [17742463       ]&lt;BR /&gt;
09:15:29 [49]   [3]     [840]&lt;BR /&gt;
09:15:29 [63]   [10]    [8000000002]&lt;/P&gt;

&lt;P&gt;a sample of my 1st attempt to pick from the 1st line: &lt;EM&gt;(?im)^(?:[^[\n]*[){3}(?P&lt;MODACO&gt;[^]]+)&lt;/MODACO&gt;&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Field name = modaco&lt;BR /&gt;
Values returned = &lt;EM&gt;123456XXXXXX1234&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 05:10:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34725#M7528</guid>
      <dc:creator>e82than</dc:creator>
      <dc:date>2011-12-14T05:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34726#M7529</link>
      <description>&lt;P&gt;Hi, using the regex;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\[(?&amp;lt;field1&amp;gt;[^\]]+)\][\s]+\[(?&amp;lt;field2&amp;gt;[^\]]+)\][\s]+\[(?&amp;lt;field3&amp;gt;[^\]]+)\]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It will capture each group of [ ]'s into their own group with the first being group 1 and so on.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 09:25:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34726#M7529</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2011-12-14T09:25:35Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34727#M7530</link>
      <description>&lt;P&gt;I guess any line is a separate event for you. Try this one, which should extract all the numbers in the row, giving them a name as line, second_number, modaco. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?i)^[^\[]+\s+\[(?&amp;lt;line&amp;gt;[^\]]+)\]\s+\[(?&amp;lt;second_number&amp;gt;[^\]]+)\]\s+\[(?&amp;lt;modaco&amp;gt;[^\]]+)\]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Edit: if all events are grouped in chunks, and multikv does not to what you want (values might end up being enclosed in square brackets...) then you might want to split them in multiple events first:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex max_match=100 "(?m)^(?&amp;lt;rows&amp;gt;.+)$" | mvexpand rows | eval _raw=rows | rex field=rows "(?i)^[^\[]+\s+\[(?&amp;lt;line&amp;gt;[^\]]+)\]\s+\[(?&amp;lt;second_number&amp;gt;[^\]]+)\]\s+\[(?&amp;lt;modaco&amp;gt;[^\]]+)\]"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The | eval _raw=rows is just for ease of reading, but unneeded.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 09:31:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34727#M7530</guid>
      <dc:creator>Paolo_Prigione</dc:creator>
      <dc:date>2011-12-14T09:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34728#M7531</link>
      <description>&lt;P&gt;Hi, couldn't you match the end of the line?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;modaco&amp;gt;\w+)\s*]$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;UPDATE:&lt;/P&gt;

&lt;P&gt;Have you looked at &lt;CODE&gt;multikv&lt;/CODE&gt;? It is will make separate events of tabular data, e.g. output from top, netstat etc. From the look of your data, there is no header row, but this can be amended by the noheader=true option to multikv.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Multikv"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Multikv&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The simplest would of course be to have the lines indexed as separate events.&lt;/P&gt;

&lt;P&gt;hth,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 09:32:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34728#M7531</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-12-14T09:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34729#M7532</link>
      <description>&lt;P&gt;i added your regex to my props.conf as follow&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[sampleone]&lt;BR /&gt;
EXTRACT-moda = \[([^\]]+)\][\s]+\[([^\]]+)\][\s]+\[([^\]]+)\]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;can't work.. i think maybe i did not have a moda value in it.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 09:47:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34729#M7532</guid>
      <dc:creator>e82than</dc:creator>
      <dc:date>2011-12-14T09:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34730#M7533</link>
      <description>&lt;P&gt;You will need to add a field name to each one, I will edit the above to show how (if you want to do it directly through props and not a combination of props and transforms&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 09:54:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34730#M7533</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2011-12-14T09:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34731#M7534</link>
      <description>&lt;P&gt;i have an additional line called &lt;CODE&gt;SHOULD_LINEMERGE = TRUE&lt;/CODE&gt; inside the props.conf. therefore, i only can pick the 1st line in the event. i needed line &lt;CODE&gt;[37]&lt;/CODE&gt; and it's not coming out...&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 10:03:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34731#M7534</guid>
      <dc:creator>e82than</dc:creator>
      <dc:date>2011-12-14T10:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34732#M7535</link>
      <description>&lt;P&gt;No unfortunately, I applied &lt;CODE&gt;SHOULD_LINEMERGE = TRUE&lt;/CODE&gt; to all the events coming in thru the host.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 10:09:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34732#M7535</guid>
      <dc:creator>e82than</dc:creator>
      <dc:date>2011-12-14T10:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34733#M7536</link>
      <description>&lt;P&gt;Your regex is working but not beyond the 1st row of my events. It is only picking up the 3rd square bracket of &lt;CODE&gt;09:15:29 [2] [16] [123456XXXXXX1234]&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I needed &lt;CODE&gt;09:15:29 [37] [13] [113601820946]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Thanks for your patience&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 10:16:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34733#M7536</guid>
      <dc:creator>e82than</dc:creator>
      <dc:date>2011-12-14T10:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34734#M7537</link>
      <description>&lt;P&gt;see update above /k&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 10:30:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34734#M7537</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-12-14T10:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34735#M7538</link>
      <description>&lt;P&gt;I edited the answer to match your comment&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 10:58:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34735#M7538</guid>
      <dc:creator>Paolo_Prigione</dc:creator>
      <dc:date>2011-12-14T10:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34736#M7539</link>
      <description>&lt;P&gt;Why merge them? It seems from your uses / needs it would be best to index each line as an event?&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 12:39:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34736#M7539</guid>
      <dc:creator>Drainy</dc:creator>
      <dc:date>2011-12-14T12:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34737#M7540</link>
      <description>&lt;P&gt;i would like to but the bit 2 has got meanings in them (which i have not fathom) which is needed to look together in a single time window thus i can't break it all up in bits.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 17:53:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34737#M7540</guid>
      <dc:creator>e82than</dc:creator>
      <dc:date>2011-12-14T17:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34738#M7541</link>
      <description>&lt;P&gt;i tried &lt;CODE&gt;| multikv noheaders = t&lt;/CODE&gt; as per your guidance and it's not turning out the way i wanted, I can't stats the fields. because there were square brackets in them.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2011 17:55:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34738#M7541</guid>
      <dc:creator>e82than</dc:creator>
      <dc:date>2011-12-14T17:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: giving meaning to numbers</title>
      <link>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34739#M7542</link>
      <description>&lt;P&gt;I had an alternative way of fixing my problems, sort of.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;\[37\]\s+\[12\]\s+\[(?&amp;lt;UID&amp;gt;\d+)\]&lt;/CODE&gt; this regex will pick field 37. I was lost for a while till i come to think of anchoring my searches to my text. Also, UID is the name to call the field picked up. To setup the field extraction, just go to field extraction,add new. Give a new name to NAME, any name, it would not mattered anyway what is it called in field extraction because we have named out field as UID in the regex string.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2011 03:13:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/giving-meaning-to-numbers/m-p/34739#M7542</guid>
      <dc:creator>e82than</dc:creator>
      <dc:date>2011-12-16T03:13:04Z</dc:date>
    </item>
  </channel>
</rss>

