<?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 How do I include fields from a lookup table to charted data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-include-fields-from-a-lookup-table-to-charted-data/m-p/146689#M40959</link>
    <description>&lt;P&gt;I'm using this search to retrieve indexing data by month;&lt;/P&gt;

&lt;P&gt;index="_internal" source="*metrics.log" group="per_host_thruput"| chart sum(kb) by series date_month | sort + series&lt;/P&gt;

&lt;P&gt;It returns in this format, which works well for me.&lt;/P&gt;

&lt;P&gt;HOST January February March ...&lt;BR /&gt;
hosta 1234567 1234567 1234567 ... &lt;BR /&gt;
hostb 2345678 1234567 1234567 ...&lt;BR /&gt;
hostc 3456789 1234567 1234567 .&lt;/P&gt;

&lt;P&gt;I've created a lookup table that gives every indication of success when I look at the search output in event mode, I see them listed, &lt;BR /&gt;
E.g.;&lt;BR /&gt;
host_owner  Infrastructure&lt;BR /&gt;
host_role  Splunk indexer  &lt;/P&gt;

&lt;P&gt;I expect including these fields will reduce downstream questions but I'm having problems getting a good search when including them.  I think part of my problem might be that the search is actually getting the host name from the series and I'm using the data inappropriately. Actually now that I look at it I'm certain. The host for each of these servers is an indexer. &lt;/P&gt;

&lt;P&gt;Does this mean that I need to create a different lookup table? Ultimately I need to add some additional information beyond the hostname.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 18:20:30 GMT</pubDate>
    <dc:creator>pipegrep</dc:creator>
    <dc:date>2020-09-28T18:20:30Z</dc:date>
    <item>
      <title>How do I include fields from a lookup table to charted data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-include-fields-from-a-lookup-table-to-charted-data/m-p/146689#M40959</link>
      <description>&lt;P&gt;I'm using this search to retrieve indexing data by month;&lt;/P&gt;

&lt;P&gt;index="_internal" source="*metrics.log" group="per_host_thruput"| chart sum(kb) by series date_month | sort + series&lt;/P&gt;

&lt;P&gt;It returns in this format, which works well for me.&lt;/P&gt;

&lt;P&gt;HOST January February March ...&lt;BR /&gt;
hosta 1234567 1234567 1234567 ... &lt;BR /&gt;
hostb 2345678 1234567 1234567 ...&lt;BR /&gt;
hostc 3456789 1234567 1234567 .&lt;/P&gt;

&lt;P&gt;I've created a lookup table that gives every indication of success when I look at the search output in event mode, I see them listed, &lt;BR /&gt;
E.g.;&lt;BR /&gt;
host_owner  Infrastructure&lt;BR /&gt;
host_role  Splunk indexer  &lt;/P&gt;

&lt;P&gt;I expect including these fields will reduce downstream questions but I'm having problems getting a good search when including them.  I think part of my problem might be that the search is actually getting the host name from the series and I'm using the data inappropriately. Actually now that I look at it I'm certain. The host for each of these servers is an indexer. &lt;/P&gt;

&lt;P&gt;Does this mean that I need to create a different lookup table? Ultimately I need to add some additional information beyond the hostname.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:20:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-include-fields-from-a-lookup-table-to-charted-data/m-p/146689#M40959</guid>
      <dc:creator>pipegrep</dc:creator>
      <dc:date>2020-09-28T18:20:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I include fields from a lookup table to charted data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-include-fields-from-a-lookup-table-to-charted-data/m-p/146690#M40960</link>
      <description>&lt;P&gt;Hello pipegrep,&lt;/P&gt;

&lt;P&gt;I think you could resolve you problem with a single lookup, let's say hosts.csv, which would looks like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host, role, owner
hosta, aaa, john
hostb, ccc, mary
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;now you could use your search like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" source="*metrics.log" group="per_host_thruput"| chart sum(kb) by series date_month | lookup hosts.csv host | sort + series
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The search command would grab the corresponding Role and Owner from the lookup file and add the additional columns to your chart.&lt;/P&gt;

&lt;P&gt;ps.: remember to save your lookup inside the &lt;CODE&gt;$SPLUNK_HOME/etc/apps//lookups&lt;/CODE&gt;. `` normally is &lt;STRONG&gt;search&lt;/STRONG&gt;.&lt;/P&gt;

&lt;P&gt;Does that makes sense?&lt;/P&gt;

&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2014 03:26:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-include-fields-from-a-lookup-table-to-charted-data/m-p/146690#M40960</guid>
      <dc:creator>musskopf</dc:creator>
      <dc:date>2014-12-08T03:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I include fields from a lookup table to charted data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-include-fields-from-a-lookup-table-to-charted-data/m-p/146691#M40961</link>
      <description>&lt;P&gt;It seems like it should, but columns are not appearing. If I use the method you show and reference my CSV filename, the file is not found. Since I have a lookup table defined and saved, I used that.&lt;/P&gt;

&lt;P&gt;This search; &lt;CODE&gt;| inputlookup host_tags&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Outputs data in the anticipated format&lt;BR /&gt;
host        host_owner  host_role&lt;BR /&gt;
clks01      Infrastructure  Linux Utility Server&lt;BR /&gt;
clksapp01   Plant       FIX CMDB&lt;BR /&gt;
clksvjpvm01 YB      Clarksville YB Plant 1&lt;BR /&gt;
clksvjpvm02 YB      Clarksville YB Plant 2&lt;/P&gt;

&lt;P&gt;In the end, this search doesn't display the additional "host_tags" columns;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" source="*metrics.log" group="per_host_thruput" | chart sum(kb) by series date_month | lookup host_tags host | sort + series
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Baffling.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:20:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-include-fields-from-a-lookup-table-to-charted-data/m-p/146691#M40961</guid>
      <dc:creator>pipegrep</dc:creator>
      <dc:date>2020-09-28T18:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I include fields from a lookup table to charted data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-include-fields-from-a-lookup-table-to-charted-data/m-p/146692#M40962</link>
      <description>&lt;P&gt;The search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" source="*metrics.log" group="per_host_thruput" | chart sum(kb) by series date_month 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;is not returning a column named &lt;STRONG&gt;host&lt;/STRONG&gt; so the lookup will not be able to find anything. You could rename &lt;STRONG&gt;series&lt;/STRONG&gt; to *&lt;EM&gt;host&lt;/EM&gt; before the lookup:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="_internal" source="*metrics.log" group="per_host_thruput" | chart sum(kb) by series date_month | rename series AS host | lookup host_tags host | sort + host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Another thing to note is that lookups are case-sensitive.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Dec 2014 21:25:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-include-fields-from-a-lookup-table-to-charted-data/m-p/146692#M40962</guid>
      <dc:creator>musskopf</dc:creator>
      <dc:date>2014-12-08T21:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I include fields from a lookup table to charted data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-include-fields-from-a-lookup-table-to-charted-data/m-p/146693#M40963</link>
      <description>&lt;P&gt;And of course that was it. Thanks!&lt;/P&gt;

&lt;P&gt;index="_internal" source="*metrics.log" group="per_host_thruput" | eval gb=((kb/1024)/1024) | chart sum(kb) by series date_month | lookup host_tags host as series | sort + series&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:20:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-include-fields-from-a-lookup-table-to-charted-data/m-p/146693#M40963</guid>
      <dc:creator>pipegrep</dc:creator>
      <dc:date>2020-09-28T18:20:50Z</dc:date>
    </item>
  </channel>
</rss>

