<?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: How to extract custom dimension from metrics in Splunk App for Infrastructure during index time? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383682#M46679</link>
    <description>&lt;P&gt;I think you already have what you need for write_splunk &lt;A href="https://docs.splunk.com/Documentation/InfraApp/1.3.0/Admin/ManageAgents"&gt;https://docs.splunk.com/Documentation/InfraApp/1.3.0/Admin/ManageAgents&lt;/A&gt; . &lt;/P&gt;

&lt;P&gt;It is not Open Source yet.&lt;/P&gt;

&lt;P&gt;This document might help you: &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Data/Configureindex-timefieldextraction"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/Data/Configureindex-timefieldextraction&lt;/A&gt; .&lt;/P&gt;</description>
    <pubDate>Wed, 22 May 2019 17:24:55 GMT</pubDate>
    <dc:creator>dagarwal_splunk</dc:creator>
    <dc:date>2019-05-22T17:24:55Z</dc:date>
    <item>
      <title>How to extract custom dimension from metrics in Splunk App for Infrastructure during index time?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383676#M46673</link>
      <description>&lt;P&gt;We are using &lt;A href="https://splunkbase.splunk.com/app/3975/"&gt;Splunk App for Infrastructure&lt;/A&gt; (SAI) to analyze hadoop cluster nodes using &lt;A href="https://github.com/signalfx/integrations/tree/master/collectd-hadoop"&gt;Apache Hadoop plugin&lt;/A&gt; for collectd from SignalFx.&lt;/P&gt;

&lt;P&gt;We have tried to configure collectd to send metrics to Splunk using both &lt;CODE&gt;write_http&lt;/CODE&gt; or &lt;CODE&gt;write_splunk&lt;/CODE&gt; plugin.&lt;BR /&gt;
We have faced a problem as extracting custom &lt;CODE&gt;dimension&lt;/CODE&gt;s from metrics.&lt;/P&gt;

&lt;P&gt;We not only need "static" dimension for all metrics which we can configure in collectd plugin:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;Plugin write_splunk&amp;gt;
  ...
  Dimension "key1:value1"
&amp;lt;/Plugin&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but also would like to send "dynamic" dimension like: &lt;CODE&gt;id&lt;/CODE&gt;, &lt;CODE&gt;user&lt;/CODE&gt;, &lt;CODE&gt;name&lt;/CODE&gt;, &lt;CODE&gt;queue&lt;/CODE&gt;, &lt;CODE&gt;state&lt;/CODE&gt; and some other from &lt;A href="https://hadoop.apache.org/docs/current/hadoop-yarn/hadoop-yarn-site/ResourceManagerRest.html#Cluster_Applications_API"&gt;Cluster Applications API&lt;/A&gt;, all together more than 10 dimensions.&lt;/P&gt;

&lt;P&gt;If we use &lt;CODE&gt;write_http&lt;/CODE&gt; plugin we have a problem to extract dimension as described in another question: &lt;A href="https://answers.splunk.com/answers/741247/how-to-extract-custom-dimensions-from-plugin-insta.html"&gt;How to extract custom dimensions from plugin_instance when we are using collectd?&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;When we are using &lt;CODE&gt;write_splunk&lt;/CODE&gt; plugin our &lt;CODE&gt;metric_name&lt;/CODE&gt; looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;apache_hadoop.[id:application_1555643048019_55088,user:hive,queue:root.project_name,state:FINISHED].gauge.hadoop.resource.manager.apps.allocatedMB
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It looks like &lt;CODE&gt;plugin_instance&lt;/CODE&gt; dimension from collectd plugin is added to the metric name. And it's similar to how statsd adds dimension to the &lt;CODE&gt;metric_name&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;We would like to extract dimension form metric like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;app_id=application_1555643048019_55088
user=hive
queue=root.project_name
state=FINISHED
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;We have tried to extract dimension like described at &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Metrics/StatsdDimensions#Examples_of_configuring_dimension_extraction"&gt;Examples of configuring dimension extraction&lt;/A&gt; using configuration as following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# props.conf.example
[em_metrics]
METRICS_PROTOCOL = statsd
STATSD-DIM-TRANSFORMS = user, queue, app_id, state

# transforms.conf.example
[statsd-dims:user]
REGEX = (\Quser:\E(?&amp;lt;user&amp;gt;.*?)[\Q,\E\Q]\E])
REMOVE_DIMS_FROM_METRIC_NAME = true

...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And it's not working for us.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Can you give any advice how to extract custom dimension from metrics in Splunk App for Infrastructure during index time?&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 10:14:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383676#M46673</guid>
      <dc:creator>vladislavplaksy</dc:creator>
      <dc:date>2019-05-21T10:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract custom dimension from metrics in Splunk App for Infrastructure during index time?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383677#M46674</link>
      <description>&lt;P&gt;One issue I notice is that &lt;/P&gt;

&lt;P&gt;"REGEX = (\Qu:\E(?.*?)[\Q,\E\Q]\E])"&lt;/P&gt;

&lt;P&gt;doesn't look like a correct regex format in Splunk. &lt;/P&gt;

&lt;P&gt;See: &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Knowledge/AboutSplunkregularexpressions"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/Knowledge/AboutSplunkregularexpressions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Edit: Even looking at it as the "\Q\E" flavor of Regex, I don't see where the "u:" is coming from.&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 22:01:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383677#M46674</guid>
      <dc:creator>pwu_splunk</dc:creator>
      <dc:date>2019-05-21T22:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract custom dimension from metrics in Splunk App for Infrastructure during index time?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383678#M46675</link>
      <description>&lt;P&gt;You can try something like this to extract dimensions:&lt;/P&gt;

&lt;P&gt;props.conf add:&lt;BR /&gt;
&lt;STRONG&gt;[em_metrics]&lt;BR /&gt;
TRANSFORMS-mname=mname&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Transforms.conf add:&lt;BR /&gt;
&lt;STRONG&gt;[mname]&lt;BR /&gt;
SOURCE_KEY = field:metric_name&lt;BR /&gt;
REGEX = apache_hadoop\.\[id:([^,]+),user:([^,]+),queue:([^,]+),state:([^\]]+)\]\.\S+&lt;BR /&gt;
FORMAT = id::$1 user::$2 queue::$3 state::$4&lt;BR /&gt;
WRITE_META = true&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Make adjustments as you need..&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:37:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383678#M46675</guid>
      <dc:creator>dagarwal_splunk</dc:creator>
      <dc:date>2020-09-30T00:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract custom dimension from metrics in Splunk App for Infrastructure during index time?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383679#M46676</link>
      <description>&lt;P&gt;@pwu_splunk &lt;BR /&gt;
Thank you for your reply. It was misspelling here.&lt;BR /&gt;
We are using shortcut name of dimensions as for example: user -&amp;gt; u, queue -&amp;gt; q, state -&amp;gt; s etc.&lt;BR /&gt;
I didn't changed this in all places. I have updated my question.&lt;BR /&gt;
Correct version&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    # transforms.conf.example
    [statsd-dims:user]
    REGEX = (\Quser:\E(?&amp;lt;user&amp;gt;.*?)[\Q,\E\Q]\E])
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 May 2019 07:07:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383679#M46676</guid>
      <dc:creator>vladislavplaksy</dc:creator>
      <dc:date>2019-05-22T07:07:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract custom dimension from metrics in Splunk App for Infrastructure during index time?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383680#M46677</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/128477"&gt;@dagarwal_splunk&lt;/a&gt; &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/98885"&gt;@pwu_splunk&lt;/a&gt; &lt;BR /&gt;
As far as I understand you are working in Splunk. &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Could you provide a link to &lt;CODE&gt;write_splunk&lt;/CODE&gt; documentation. &lt;/LI&gt;
&lt;LI&gt;Or link to source code, in case this plugin is open source.&lt;/LI&gt;
&lt;LI&gt;Or redirect this question to Splunk App for Infrastructure developers or support team.&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:39:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383680#M46677</guid>
      <dc:creator>vladislavplaksy</dc:creator>
      <dc:date>2020-09-30T00:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract custom dimension from metrics in Splunk App for Infrastructure during index time?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383681#M46678</link>
      <description>&lt;P&gt;Did you try the other props/transforms above?&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 17:14:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383681#M46678</guid>
      <dc:creator>dagarwal_splunk</dc:creator>
      <dc:date>2019-05-22T17:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract custom dimension from metrics in Splunk App for Infrastructure during index time?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383682#M46679</link>
      <description>&lt;P&gt;I think you already have what you need for write_splunk &lt;A href="https://docs.splunk.com/Documentation/InfraApp/1.3.0/Admin/ManageAgents"&gt;https://docs.splunk.com/Documentation/InfraApp/1.3.0/Admin/ManageAgents&lt;/A&gt; . &lt;/P&gt;

&lt;P&gt;It is not Open Source yet.&lt;/P&gt;

&lt;P&gt;This document might help you: &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Data/Configureindex-timefieldextraction"&gt;https://docs.splunk.com/Documentation/Splunk/7.2.6/Data/Configureindex-timefieldextraction&lt;/A&gt; .&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 17:24:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383682#M46679</guid>
      <dc:creator>dagarwal_splunk</dc:creator>
      <dc:date>2019-05-22T17:24:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract custom dimension from metrics in Splunk App for Infrastructure during index time?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383683#M46680</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;REGEX = (\Quser:\E(?&amp;lt;user&amp;gt;.*?)[\Q,\E\Q]\E])
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I still suspect this format is incorrect. See &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.2.6/Knowledge/AboutSplunkregularexpressions"&gt;the link on how to format Splunk regexes&lt;/A&gt; and the table inside on valid characters. I've only seen standard-form regexes in Splunk.&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 23:58:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/How-to-extract-custom-dimension-from-metrics-in-Splunk-App-for/m-p/383683#M46680</guid>
      <dc:creator>pwu_splunk</dc:creator>
      <dc:date>2019-05-22T23:58:03Z</dc:date>
    </item>
  </channel>
</rss>

