<?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: Using lookup table data and event data to create a chart in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292670#M7348</link>
    <description>&lt;P&gt;I now see what I was missing. I was assuming one Area will have one Office. Which might not be the case. &lt;/P&gt;</description>
    <pubDate>Fri, 18 Aug 2017 09:51:50 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2017-08-18T09:51:50Z</dc:date>
    <item>
      <title>Using lookup table data and event data to create a chart</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292663#M7341</link>
      <description>&lt;P&gt;I have a lookup table that has following headers &lt;STRONG&gt;Area&lt;/STRONG&gt;, &lt;STRONG&gt;Office&lt;/STRONG&gt; (area code and office number). There are many offices under each area and Splunk events include office number but no area code. Is there a way to create a query that could create a chart where there is area code on X axis and Y axis could have purchasePrice (purchasePrice is included on logs)? Is Splunk able to read lookup table area codes and link them to office codes that can be found from events done in application?&lt;/P&gt;

&lt;P&gt;Query that I've tried to use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype=*| inputlookup regions.csv Area Office | stats avg(purchasePrice) as Price by Area 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Aug 2017 11:46:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292663#M7341</guid>
      <dc:creator>Jurala</dc:creator>
      <dc:date>2017-08-17T11:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using lookup table data and event data to create a chart</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292664#M7342</link>
      <description>&lt;P&gt;What is the field name for Office in your Splunk events. Following query assumes field name for Office is the same in your Splunk Event and Lookup File. Also, assumes you have created a &lt;CODE&gt;Lookup Definition&lt;/CODE&gt; for &lt;CODE&gt;region.csv&lt;/CODE&gt; as &lt;CODE&gt;region&lt;/CODE&gt;, you can try the following command&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype=* [ inputlookup regions.csv | table Office]
| stats avg(purchasePrice) as Price by Office
| lookup regions Office output Area 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In case your Splunk events has Office number by a different field name (for example office_number), you can try following instead:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype=* [ inputlookup regions.csv | rename Office as office_number | table office_number ]
| stats avg(purchasePrice) as Price by office_number
| lookup regions Office as office_number output Area 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Refer to Splunk lookup command documentation: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Lookup#Basic_example"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Lookup#Basic_example&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 12:55:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292664#M7342</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-08-17T12:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using lookup table data and event data to create a chart</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292665#M7343</link>
      <description>&lt;P&gt;What is the problem with your search? And is it semantically correct to link area codes to offices codes?&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 13:13:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292665#M7343</guid>
      <dc:creator>rvany</dc:creator>
      <dc:date>2017-08-17T13:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using lookup table data and event data to create a chart</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292666#M7344</link>
      <description>&lt;P&gt;The verb you are looking for is &lt;CODE&gt;lookup&lt;/CODE&gt;, not &lt;CODE&gt;inputlookup&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query that gets Office number and purchasePrice
| fields Office purchasePrice 
| lookup regions.csv Office OUTPUT Area
| stats avg(purchasePrice) by Area  
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Aug 2017 14:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292666#M7344</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-17T14:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using lookup table data and event data to create a chart</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292667#M7345</link>
      <description>&lt;P&gt;@DalJeanis. If there is one to one mapping between Area and Office, ideally stats should be done first then lookup so that there are less events to correlate.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Lookup#Optimizing_your_lookup_search"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Lookup#Optimizing_your_lookup_search&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Also, I had inputlookup in the base search to find only events with Office same as those mentioned in lookup files (to filter results upfront).&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 15:46:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292667#M7345</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-08-17T15:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using lookup table data and event data to create a chart</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292668#M7346</link>
      <description>&lt;P&gt;@niketnilay - Good point.  In that case, we would need to retain the components in order to get a valid average at the Area level. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; your query that gets Office number and purchasePrice
 | fields Office purchasePrice 
 | stats count as mycount sum(purchasePrice) as mysum by Office  
 | lookup regions.csv Office OUTPUT Area
 | stats sum(mycount) as mycount sum(mysum) as mysum by Area
 | eval Price=mysum/mycount
 | table Area Price
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Aug 2017 16:28:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292668#M7346</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-17T16:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using lookup table data and event data to create a chart</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292669#M7347</link>
      <description>&lt;P&gt;@niketnilay By the way, great picture!&lt;/P&gt;</description>
      <pubDate>Thu, 17 Aug 2017 16:28:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292669#M7347</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-08-17T16:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Using lookup table data and event data to create a chart</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292670#M7348</link>
      <description>&lt;P&gt;I now see what I was missing. I was assuming one Area will have one Office. Which might not be the case. &lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 09:51:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292670#M7348</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-08-18T09:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using lookup table data and event data to create a chart</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292671#M7349</link>
      <description>&lt;P&gt;Thanks. Surprisingly I am so used to of seeing an icon against my name, that I am not able to recognize my own pic &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Aug 2017 09:54:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Using-lookup-table-data-and-event-data-to-create-a-chart/m-p/292671#M7349</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-08-18T09:54:47Z</dc:date>
    </item>
  </channel>
</rss>

