<?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 Interesting regex/transforms.conf question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Interesting-regex-transforms-conf-question/m-p/84705#M21593</link>
    <description>&lt;P&gt;My dilemma:&lt;/P&gt;

&lt;P&gt;We have a log file that dumps out info from an array.&lt;/P&gt;

&lt;P&gt;Four fields:&lt;/P&gt;

&lt;P&gt;Count&lt;BR /&gt;
FieldA&lt;BR /&gt;
FieldB&lt;BR /&gt;
FieldC&lt;/P&gt;

&lt;P&gt;In the log file, the field 'Count' will provide the number of entries in the array. There will then be 'Count' instances of each field (FieldA, FieldB, FieldC).&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;2012.02.28 00:02:00.000|Count: 1, FieldA[0]: abcdefg, FieldB[0]: 12345, FieldC[0]: 1234abcd&lt;BR /&gt;
2012.02.28 00:02:01.000|Count: 2, FieldA[0]: abcdefg, FieldB[0]: 12345, FieldC[0]: 1234abcd, FieldA[1]: hijklmn, FieldB[1]: 67890, FieldC[1]: 5678efgh&lt;/P&gt;

&lt;P&gt;We don't really care about FieldA[0] vs FieldA[1] for metrics, but we do want to know about the data for all instances of FieldA. Not sure if some combination of repetition and grouping will accomplish this or not. I will be testing it out, but was also looking for others' feedback and if they've done this before.&lt;/P&gt;

&lt;P&gt;Is there a 'simple' (and I use that term lightly) way to dynamically parse the fields using Splunk (transforms.conf, etc.)?&lt;/P&gt;</description>
    <pubDate>Mon, 05 Mar 2012 22:45:13 GMT</pubDate>
    <dc:creator>kubowler99</dc:creator>
    <dc:date>2012-03-05T22:45:13Z</dc:date>
    <item>
      <title>Interesting regex/transforms.conf question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Interesting-regex-transforms-conf-question/m-p/84705#M21593</link>
      <description>&lt;P&gt;My dilemma:&lt;/P&gt;

&lt;P&gt;We have a log file that dumps out info from an array.&lt;/P&gt;

&lt;P&gt;Four fields:&lt;/P&gt;

&lt;P&gt;Count&lt;BR /&gt;
FieldA&lt;BR /&gt;
FieldB&lt;BR /&gt;
FieldC&lt;/P&gt;

&lt;P&gt;In the log file, the field 'Count' will provide the number of entries in the array. There will then be 'Count' instances of each field (FieldA, FieldB, FieldC).&lt;/P&gt;

&lt;P&gt;For example:&lt;/P&gt;

&lt;P&gt;2012.02.28 00:02:00.000|Count: 1, FieldA[0]: abcdefg, FieldB[0]: 12345, FieldC[0]: 1234abcd&lt;BR /&gt;
2012.02.28 00:02:01.000|Count: 2, FieldA[0]: abcdefg, FieldB[0]: 12345, FieldC[0]: 1234abcd, FieldA[1]: hijklmn, FieldB[1]: 67890, FieldC[1]: 5678efgh&lt;/P&gt;

&lt;P&gt;We don't really care about FieldA[0] vs FieldA[1] for metrics, but we do want to know about the data for all instances of FieldA. Not sure if some combination of repetition and grouping will accomplish this or not. I will be testing it out, but was also looking for others' feedback and if they've done this before.&lt;/P&gt;

&lt;P&gt;Is there a 'simple' (and I use that term lightly) way to dynamically parse the fields using Splunk (transforms.conf, etc.)?&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2012 22:45:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Interesting-regex-transforms-conf-question/m-p/84705#M21593</guid>
      <dc:creator>kubowler99</dc:creator>
      <dc:date>2012-03-05T22:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: Interesting regex/transforms.conf question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Interesting-regex-transforms-conf-question/m-p/84706#M21594</link>
      <description>&lt;P&gt;Yes, this is a good use of multivalued fields and the MV_ADD property in transforms.conf. First, add a stanza in props.conf like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::.../yourfile.log*]
REPORT-numberedfields = numberedfields
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then add the corresponding stanza in transforms.conf, which directs Splunk to read fieldnames followed by an ignored number, followed by the value, and, when duplicate field names are encountered, to accumulate into the same field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[numberedfields]
REGEX = (\w+)\[\d+\]: ([^,]+)
FORMAT = $1::$2
MV_ADD = True
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Mar 2012 02:01:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Interesting-regex-transforms-conf-question/m-p/84706#M21594</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2012-03-06T02:01:19Z</dc:date>
    </item>
  </channel>
</rss>

