<?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 create a table from 3 different lookup table and get the data to line up? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320645#M4464</link>
    <description>&lt;P&gt;I have 3 lookups.  1 is primary users and a count of total users, 2 is primary users and a task, 3 is primary users and not doing task.&lt;/P&gt;

&lt;P&gt;I tried to combine their data using stats count to get the data and appendcols to format into a table.  I get the data in a table, but the data from lookups 2 and 3 do not line up with the correct primary user.  If I have 15 primary users and 10 with a count, then the 10 counts just start at the top and go down 10.  I need the 10 counts to line up with the 10 primary users they are associated with.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Feb 2017 00:12:07 GMT</pubDate>
    <dc:creator>lowden</dc:creator>
    <dc:date>2017-02-21T00:12:07Z</dc:date>
    <item>
      <title>How do I create a table from 3 different lookup table and get the data to line up?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320645#M4464</link>
      <description>&lt;P&gt;I have 3 lookups.  1 is primary users and a count of total users, 2 is primary users and a task, 3 is primary users and not doing task.&lt;/P&gt;

&lt;P&gt;I tried to combine their data using stats count to get the data and appendcols to format into a table.  I get the data in a table, but the data from lookups 2 and 3 do not line up with the correct primary user.  If I have 15 primary users and 10 with a count, then the 10 counts just start at the top and go down 10.  I need the 10 counts to line up with the 10 primary users they are associated with.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 00:12:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320645#M4464</guid>
      <dc:creator>lowden</dc:creator>
      <dc:date>2017-02-21T00:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a table from 3 different lookup table and get the data to line up?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320646#M4465</link>
      <description>&lt;P&gt;You would need to provide more details on the fields and if possible sample data... For example if the two fields in first lookup are &lt;STRONG&gt;user&lt;/STRONG&gt; and &lt;STRONG&gt;count&lt;/STRONG&gt;, second lookup is &lt;STRONG&gt;user&lt;/STRONG&gt; and &lt;STRONG&gt;task_performed&lt;/STRONG&gt; and third one is &lt;STRONG&gt;user&lt;/STRONG&gt; and &lt;STRONG&gt;task_not_performed&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;Your Base Search&amp;gt;
| stats values(count) as Count values(task_performed) values(task_not_performed) by user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:59:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320646#M4465</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T12:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a table from 3 different lookup table and get the data to line up?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320647#M4466</link>
      <description>&lt;P&gt;I am not allowed to provide anymore detail.  However, I appreciate your answer and will give it a try.  Thanks for you help.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 22:27:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320647#M4466</guid>
      <dc:creator>lowden</dc:creator>
      <dc:date>2017-02-21T22:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a table from 3 different lookup table and get the data to line up?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320648#M4467</link>
      <description>&lt;P&gt;You don't need to provide the actual data, it'd be enough to post a small dummy data set for each table.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2017 23:17:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320648#M4467</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2017-02-21T23:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a table from 3 different lookup table and get the data to line up?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320649#M4468</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;As both @martin_mueller and @niketnilay mentioned, it would be great if you could post your searches and a small set of dummy data.&lt;/P&gt;

&lt;P&gt;But without that, here are a couple of ways which may work...&lt;/P&gt;

&lt;P&gt;I've just put some dummy data into 3 csv files to simulate your 3 lookups / searches. These are:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;users-count.csv&lt;/EM&gt;&lt;BR /&gt;
user,total_count&lt;BR /&gt;
bob,3&lt;BR /&gt;
fred,3&lt;BR /&gt;
dave,3&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;users-task.csv&lt;/EM&gt;&lt;BR /&gt;
user,task&lt;BR /&gt;
bob,swimming&lt;BR /&gt;
fred,running&lt;BR /&gt;
dave,kayaking&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;users-not-task.csv&lt;/EM&gt;&lt;BR /&gt;
user,not_task&lt;BR /&gt;
bob,reading&lt;BR /&gt;
fred,writing&lt;BR /&gt;
dave,splunking&lt;/P&gt;

&lt;P&gt;These are in my $SPLUNK_HOME/etc/system/lookups folder, on a test Splunk instance on my laptop (this is for testing; not production). I can get this info into Splunk using the search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| from inputlookup:"users-count.csv"
| append [| from inputlookup:"users-task.csv"]
| append [| from inputlookup:"users-not-task.csv"]
| table user total_count task not_task
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which looks like this:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2528i01058C2EA46F3C06/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Which sounds a bit like the situation you described where fields aren't lining up.&lt;/P&gt;

&lt;P&gt;So a couple of options. This should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| from inputlookup:"users-count.csv"
| appendcols [| from inputlookup:"users-task.csv"]
| appendcols [| from inputlookup:"users-not-task.csv"]
| table user total_count task not_task
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or you could use a join and do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| from inputlookup:"users-count.csv"
| join user [| from inputlookup:"users-task.csv"]
| join user [| from inputlookup:"users-not-task.csv"]
| table user total_count task not_task
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The results from both of these searches output the same in this test:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2529iEF8518922A6DDB8F/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;This is just an example of what 'might' work for you. All a bit theoretical without a bit more detail around exactly what you're trying to achieve.&lt;/P&gt;

&lt;P&gt;But maybe it will spark an idea or give you something else to try.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 04:37:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320649#M4468</guid>
      <dc:creator>gvmorley</dc:creator>
      <dc:date>2017-02-22T04:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a table from 3 different lookup table and get the data to line up?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320650#M4469</link>
      <description>&lt;P&gt;2 of my lookups are not working.  I have asked the Admin person to fix them (Admin created them).  I will try your suggestions as soon as I can.  As a side note, I am very new to Splunk.  Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 23:22:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320650#M4469</guid>
      <dc:creator>lowden</dc:creator>
      <dc:date>2017-02-22T23:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a table from 3 different lookup table and get the data to line up?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320651#M4470</link>
      <description>&lt;P&gt;I want to update on this post.  I got it to work by using appendcols.  My main problem was each look up did not have the exact same user names.  Once I deleted the user names that were not in all three lookups the numbers lined up.  I then used table to arrange the 3 columns in a way to get a good bubble chart.  Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2017 23:57:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320651#M4470</guid>
      <dc:creator>lowden</dc:creator>
      <dc:date>2017-03-13T23:57:47Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a table from 3 different lookup table and get the data to line up?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320652#M4471</link>
      <description>&lt;P&gt;Great to hear that you got it working!&lt;/P&gt;

&lt;P&gt;If you're happy that the question is resolved, just accept this as the answer, then it gets marked a 'done' when others are looking.&lt;/P&gt;

&lt;P&gt;Happy Splunking!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Mar 2017 04:03:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-do-I-create-a-table-from-3-different-lookup-table-and-get/m-p/320652#M4471</guid>
      <dc:creator>gvmorley</dc:creator>
      <dc:date>2017-03-14T04:03:52Z</dc:date>
    </item>
  </channel>
</rss>

