<?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: effective way to parse similar pattern in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109335#M22987</link>
    <description>&lt;P&gt;This time is it not about key and value, We are doing this, but for any API getting this value using key-pair will take long log message. hence we made little effective and producing this in above manner. &lt;BR /&gt;
I am doing below parsing &lt;/P&gt;

&lt;P&gt;getOAuthToken=(?(getOauth_totalExecTime&amp;gt;\d+):(?(getOauth_avgExecTime&amp;gt;\d+):(?(getOauth_noOfExecutions&amp;gt;\d+):(?(getOauth_minTime&amp;gt;\d+):(?(getOauth_maxTime&amp;gt;\d+)&lt;/P&gt;

&lt;P&gt;I want a way to effectively use the api name and associate with new key values like.&lt;/P&gt;

&lt;P&gt;getCall_TotalTime&lt;BR /&gt;
getCall_AvgTime&lt;BR /&gt;
getCall_AvgTime&lt;BR /&gt;
getCall_Occurance&lt;BR /&gt;
getCall_MInTime&lt;BR /&gt;
getCall_MaxTime&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 18:06:57 GMT</pubDate>
    <dc:creator>sumitnagal</dc:creator>
    <dc:date>2020-09-28T18:06:57Z</dc:date>
    <item>
      <title>effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109333#M22985</link>
      <description>&lt;P&gt;I have log which is printing value of an API in this manner &lt;BR /&gt;
getCall=144:144:1:144:144 where I am parsing the value like this and getting desire values for this call&lt;/P&gt;

&lt;P&gt;getCall=(?\d+):(?\d+):(?\d+):(?\d+):(?\d+)&lt;/P&gt;

&lt;P&gt;I want to know if there is effective way to calculate this values, as I have ton's of api, adding this logic and building is not a great solution. please share your thought to optimize this query so that it will be applicable to all calls&lt;/P&gt;</description>
      <pubDate>Sat, 08 Nov 2014 09:37:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109333#M22985</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2014-11-08T09:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109334#M22986</link>
      <description>&lt;P&gt;Have your logs produce data in &lt;CODE&gt;key=value&lt;/CODE&gt; format the way you'll be using it later, then Splunk will do all the extractions for you out of the box.&lt;/P&gt;

&lt;P&gt;Alternatively, you could produce JSON data that describes itself.&lt;/P&gt;

&lt;P&gt;For extracting those fields at index-time(!!), use this:&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
...
TRANSFORMS-apifields = apifields_total,apifields_avg,apifields_count,apifields_min,apifields_max
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[apifields_total]
WRITE_META = true
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)
FORMAT = $1_total::$2

[apifields_avg]
WRITE_META = true
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)
FORMAT = $1_avg::$3

[apifields_count]
WRITE_META = true
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)
FORMAT = $1_count::$4

[apifields_min]
WRITE_META = true
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)
FORMAT = $1_min::$5

[apifields_max]
WRITE_META = true
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)
FORMAT = $1_max::$6
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 08 Nov 2014 10:54:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109334#M22986</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-11-08T10:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109335#M22987</link>
      <description>&lt;P&gt;This time is it not about key and value, We are doing this, but for any API getting this value using key-pair will take long log message. hence we made little effective and producing this in above manner. &lt;BR /&gt;
I am doing below parsing &lt;/P&gt;

&lt;P&gt;getOAuthToken=(?(getOauth_totalExecTime&amp;gt;\d+):(?(getOauth_avgExecTime&amp;gt;\d+):(?(getOauth_noOfExecutions&amp;gt;\d+):(?(getOauth_minTime&amp;gt;\d+):(?(getOauth_maxTime&amp;gt;\d+)&lt;/P&gt;

&lt;P&gt;I want a way to effectively use the api name and associate with new key values like.&lt;/P&gt;

&lt;P&gt;getCall_TotalTime&lt;BR /&gt;
getCall_AvgTime&lt;BR /&gt;
getCall_AvgTime&lt;BR /&gt;
getCall_Occurance&lt;BR /&gt;
getCall_MInTime&lt;BR /&gt;
getCall_MaxTime&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:06:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109335#M22987</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2020-09-28T18:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109336#M22988</link>
      <description>&lt;P&gt;I see, you're trying to extract the first part of the field name from the event and infer the second part of the field name from the position within the event? Try this:&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your_sourcetype]
...
TRANSFORMS-apifields = apifields_total,apifields_avg,apifields_count,apifields_min,apifields_max
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[apifields_total]
WRITE_META = true
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)
FORMAT = $1_total::$2

[apifields_avg]
WRITE_META = true
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)
FORMAT = $1_avg::$3

[apifields_count]
WRITE_META = true
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)
FORMAT = $1_count::$4

[apifields_min]
WRITE_META = true
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)
FORMAT = $1_min::$5

[apifields_max]
WRITE_META = true
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)
FORMAT = $1_max::$6
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 08 Nov 2014 20:14:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109336#M22988</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-11-08T20:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109337#M22989</link>
      <description>&lt;P&gt;I have done above formatting but it is not working as we are expecting. though it is putting  value on total,avg,min and max but not with $1. Not sure formatting is concat $1 and string value ?? &lt;BR /&gt;
BTW,  my other pattern are working fine where I am assigning the value as $1::$2 &lt;/P&gt;</description>
      <pubDate>Sat, 08 Nov 2014 21:26:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109337#M22989</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2014-11-08T21:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109338#M22990</link>
      <description>&lt;P&gt;The underscore might be confusing the &lt;CODE&gt;$1&lt;/CODE&gt;, try &lt;CODE&gt;$1.total&lt;/CODE&gt; etc.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Nov 2014 22:17:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109338#M22990</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-11-08T22:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109339#M22991</link>
      <description>&lt;P&gt;No success ..&lt;BR /&gt;
I have same configuration, I have multiple of this values in and event &lt;BR /&gt;
I feel somehow, adding to extracted value with string causing issue ..&lt;/P&gt;</description>
      <pubDate>Sat, 08 Nov 2014 23:43:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109339#M22991</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2014-11-08T23:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109340#M22992</link>
      <description>&lt;P&gt;transform&lt;BR /&gt;
[apifields_totaltime]&lt;BR /&gt;
CLEAN_KEYS = 1&lt;BR /&gt;
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)&lt;BR /&gt;
FORMAT = $1.totaltime::$2&lt;BR /&gt;
SOURCE_KEY = _raw&lt;BR /&gt;
MV_ADD = 1&lt;/P&gt;

&lt;P&gt;[apifields_avgtime]&lt;BR /&gt;
CLEAN_KEYS = 1&lt;BR /&gt;
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)&lt;BR /&gt;
FORMAT = $1_avgtime::$3&lt;BR /&gt;
SOURCE_KEY = getDataStack&lt;BR /&gt;
MV_ADD = 1&lt;/P&gt;

&lt;P&gt;[apifields_totalno]&lt;BR /&gt;
CLEAN_KEYS = 1&lt;BR /&gt;
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)&lt;BR /&gt;
FORMAT = $1_totalno::$4&lt;BR /&gt;
SOURCE_KEY = getDataStack&lt;BR /&gt;
MV_ADD = 1&lt;/P&gt;

&lt;P&gt;[apifields_mintime]&lt;BR /&gt;
CLEAN_KEYS = 1&lt;BR /&gt;
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)&lt;BR /&gt;
FORMAT = $1_mintime::$5&lt;BR /&gt;
SOURCE_KEY = getDataStack&lt;BR /&gt;
MV_ADD = 1&lt;/P&gt;

&lt;P&gt;[apifields_maxtime]&lt;BR /&gt;
CLEAN_KEYS = 1&lt;BR /&gt;
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)&lt;BR /&gt;
FORMAT = $1_maxtime::$6&lt;BR /&gt;
SOURCE_KEY = getDataStack&lt;BR /&gt;
MV_ADD = 1&lt;/P&gt;

&lt;P&gt;props &lt;BR /&gt;
[fdpacq]&lt;BR /&gt;
REPORT-REPORT-getDataAcq = extractserverStack,apifields_totaltime,apifields_avgtime,apifields_totalno,apifields_mintime,apifields_maxtime&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:07:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109340#M22992</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2020-09-28T18:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109341#M22993</link>
      <description>&lt;P&gt;I see the issue now, concatenated FORMAT values only work for index-time extractions. I have updated my configuration post for that. Note, this will only take effect for data indexed after setting this.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Nov 2014 00:19:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109341#M22993</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-11-09T00:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109342#M22994</link>
      <description>&lt;P&gt;We have made change on indexer, and still not able to see any result. sorry to coming late on this, but I don't have access to make this change and has to work with splunk admin team. &lt;/P&gt;</description>
      <pubDate>Fri, 12 Dec 2014 07:08:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109342#M22994</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2014-12-12T07:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109343#M22995</link>
      <description>&lt;P&gt;Did you restart the indexers and look at data indexed after that?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Dec 2014 10:26:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109343#M22995</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-12-12T10:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109344#M22996</link>
      <description>&lt;P&gt;Yes, I did. I am giving configuration too, which I have set. &lt;/P&gt;

&lt;P&gt;Transform.conf &lt;/P&gt;

&lt;P&gt;[apifields_total]&lt;BR /&gt;
WRITE_META = true&lt;BR /&gt;
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)&lt;BR /&gt;
FORMAT = $1.total::$2&lt;/P&gt;

&lt;P&gt;[apifields_avg]&lt;BR /&gt;
WRITE_META = true&lt;BR /&gt;
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)&lt;BR /&gt;
FORMAT = $1_avg::$3&lt;/P&gt;

&lt;P&gt;[apifields_count]&lt;BR /&gt;
WRITE_META = true&lt;BR /&gt;
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)&lt;BR /&gt;
FORMAT = $1.count::$4&lt;/P&gt;

&lt;P&gt;[apifields_min]&lt;BR /&gt;
WRITE_META = true&lt;BR /&gt;
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)&lt;BR /&gt;
FORMAT = $1_min::$5&lt;/P&gt;

&lt;P&gt;[apifields_max]&lt;BR /&gt;
WRITE_META = true&lt;BR /&gt;
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)&lt;BR /&gt;
FORMAT = $1_max::$6&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
[fdpacq]&lt;BR /&gt;
pulldown_type = 1&lt;BR /&gt;
TRANSFORMS-apifields = apifields_total,apifields_avg,apifields_count,apifields_min,apifields_max&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:27:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109344#M22996</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2020-09-28T18:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109345#M22997</link>
      <description>&lt;P&gt;My Bad, I thought indexer has been restarted. but it was not, I have restarted and things are started working as we thought. on slide node, underscore or ., both are working.&lt;/P&gt;

&lt;P&gt;Sorry about confusion and thanks a lot.&lt;/P&gt;

&lt;P&gt;-Sumit &lt;/P&gt;</description>
      <pubDate>Wed, 17 Dec 2014 07:11:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109345#M22997</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2014-12-17T07:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109346#M22998</link>
      <description>&lt;P&gt;I found intersting observation not sure, if that is way how splunk works &lt;/P&gt;

&lt;P&gt;[apifields_min]&lt;BR /&gt;
WRITE_META = true&lt;BR /&gt;
REGEX = (\w+)=(\d+):(\d+):(\d+):(\d+):(\d+)&lt;BR /&gt;
FORMAT = $1_min::$5&lt;BR /&gt;
MV_ADD = 1&lt;BR /&gt;
Not able to parse MV_ADD option, and showing only first occurrence only.&lt;/P&gt;

&lt;P&gt;[apifields_min1]&lt;BR /&gt;
WRITE_META = true&lt;BR /&gt;
REGEX = (\w+):(\d+):(\d+):(\d+):(\d+):(\d+)&lt;BR /&gt;
FORMAT = $1_min::$5&lt;BR /&gt;
MV_ADD = 1&lt;BR /&gt;
Not able to parse MV_ADD option, and showing only first occurrence only.&lt;/P&gt;

&lt;P&gt;Not sure for key=value pair I have to add some special multi param in transform file, so that same pattern can be allowed.&lt;/P&gt;

&lt;P&gt;-Sumit&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:28:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109346#M22998</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2020-09-28T18:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109347#M22999</link>
      <description>&lt;P&gt;Please check my last comment, it is just picking first value, not all.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jan 2015 00:30:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109347#M22999</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2015-01-17T00:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109348#M23000</link>
      <description>&lt;P&gt;&lt;CODE&gt;MV_ADD&lt;/CODE&gt; is only valid for search-time extractions, see &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.1/Admin/transformsconf"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.1/Admin/transformsconf&lt;/A&gt; for reference.&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jan 2015 00:32:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109348#M23000</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2015-01-17T00:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: effective way to parse similar pattern</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109349#M23001</link>
      <description>&lt;P&gt;hhmmm &lt;/P&gt;

&lt;P&gt;so this solution doesn't work at all, as we are doing this at index time &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;BR /&gt;
any other approach, or should i raise to to splunk support team. &lt;/P&gt;

&lt;P&gt;-Sumit &lt;/P&gt;</description>
      <pubDate>Wed, 28 Jan 2015 04:41:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/effective-way-to-parse-similar-pattern/m-p/109349#M23001</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2015-01-28T04:41:51Z</dc:date>
    </item>
  </channel>
</rss>

