<?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: Automatic lookup and metrics index in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Automatic-lookup-and-metrics-index/m-p/306808#M164713</link>
    <description>&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.0/Metrics/Search"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.0/Metrics/Search&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Dec 2017 22:47:54 GMT</pubDate>
    <dc:creator>tcole_splunk</dc:creator>
    <dc:date>2017-12-04T22:47:54Z</dc:date>
    <item>
      <title>Automatic lookup and metrics index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Automatic-lookup-and-metrics-index/m-p/306805#M164710</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I configured an automatic lookup table to be active on a metrics index via Splunk Web (I do not have access right to the indexers/search-heads directly). I try configuring it via both source (linking the source file from which I monitor metric collection) and sourcetype (which is metrics_csv).&lt;/P&gt;

&lt;P&gt;My lookup table is quite simple (measuring only two metrics for now):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;metric_id,metricname
1111,CPU Utilization
2222,Memory Utilization
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The lookup rule is the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;metric_lookup_definition metric_id AS metric_name OUTPUTNEW metric_id AS metric_id metricname AS full_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the search I am doing is similar to this one:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| mstats prestats=true avg(_value) max(_value) WHERE sourcetype=metrics_csv metric_name="*"  component_ID="a05170000001" span=1s by metric_name
| timechart avg(_value) AS "Avg", max(_value) AS "Max" by full_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I expected to get the "human readable" names for the metrics ID ("CPU Utilization" and "Memory Utilization"), but I have one "NULL" value instead.&lt;/P&gt;

&lt;P&gt;I have no problems when explicitly calling the lookup in the search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| mstats prestats=true avg(_value) max(_value) WHERE sourcetype=metrics_csv metric_name="*"  component_ID="a05170000001" span=1s by metric_name
|lookup metric_lookup_definition metric_id AS metric_name OUTPUTNEW metric_id AS metric_id metricname AS full_name
| timechart avg(_value) AS "Avg", max(_value) AS "Max" by full_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is it possible to use automatic lookup tables with metrics indexes? Did I do something wrong?&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 09:25:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Automatic-lookup-and-metrics-index/m-p/306805#M164710</guid>
      <dc:creator>jwillaime</dc:creator>
      <dc:date>2017-11-29T09:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic lookup and metrics index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Automatic-lookup-and-metrics-index/m-p/306806#M164711</link>
      <description>&lt;P&gt;I'm not sure how metrics react to lookups and I will research that personally but I think the best way to do what you want is to use a _dimension.  In your CSV add a column called full_name and put the human readable name there. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| mstats prestats=true avg(_value) max(_value) 
         WHERE sourcetype=metrics_csv metric_name="*" 
         component_ID="a05170000001" 
         span=1s 
         by full_name
| timechart avg(_value) AS "Avg", 
            max(_value) AS "Max" by full_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With this process there are less "pieces" to break and you don't have to maintain the lookup and with the way, metrics are charged.. it's free. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Update on lookup&lt;/EM&gt;&lt;/STRONG&gt;: &lt;BR /&gt;
I &lt;EM&gt;think&lt;/EM&gt; the reason it isn't working is that mstats doesn't return metadata like sourcetype, source or host (the information used for automatic lookup.)  If you added sourcetype as part of the "by" statement it may work but again, I think your best option is to add it as a dimension. The performance impact of splitting by sourcetype isn't worth it IMO.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:58:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Automatic-lookup-and-metrics-index/m-p/306806#M164711</guid>
      <dc:creator>bsonposh</dc:creator>
      <dc:date>2020-09-29T16:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic lookup and metrics index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Automatic-lookup-and-metrics-index/m-p/306807#M164712</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;

&lt;P&gt;Automatic lookups do not work with metrics. The reason behind this is that automatic lookups are applied to individual events, whereas metrics are analyzed as an aggregate. Please see this &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.0/Metrics/Search"&gt;documentation&lt;/A&gt; for more information on searching and monitoring metrics.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 22:20:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Automatic-lookup-and-metrics-index/m-p/306807#M164712</guid>
      <dc:creator>tcole_splunk</dc:creator>
      <dc:date>2017-12-01T22:20:52Z</dc:date>
    </item>
    <item>
      <title>Re: Automatic lookup and metrics index</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Automatic-lookup-and-metrics-index/m-p/306808#M164713</link>
      <description>&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.0/Metrics/Search"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.0/Metrics/Search&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 22:47:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Automatic-lookup-and-metrics-index/m-p/306808#M164713</guid>
      <dc:creator>tcole_splunk</dc:creator>
      <dc:date>2017-12-04T22:47:54Z</dc:date>
    </item>
  </channel>
</rss>

