Splunk Search

Lookup from multiple table

basics
Explorer

Hello,

my goal is to find and combine data from multiple source.

Here:

  • employee_lookup: the table for all employee database
  • product_lookup: the table for all the product 

now my goal is to find, how many company wide product each department uses and group by DepartmentName, ProductName, and Count.

The department name is on the  "employee_lookup" table along with employee name, department name. So when any employee clicks on a product, it is counted as a product use and logs the data into Splunk.

my Splunk query is as follows:

 

data = "global"
|  lookup  product_lookup productID OUTPUT ProductName
|  lookup employee_lookup userID OUTPUT DepartmentName
|  table ProductName, DepartmentName, UserID

that query does not work...

 

My goal is to find the total count of product usages by Department. 

The resulting table should be like:

 

DepartmentName,     Product,     count
--------------------------------------------------
Dept_5,     Product1234,     2000
Dept_5,     Product333,     1434
Dept_5,     Product633,     600
Dept_2,   Product333,     2500
Dept_2,   Product215,     2500
Dept_2,   Product415,     1200
....

so basically group by department, product, count 

any suggestions and recommendation would be very helpful. Thank you!

Labels (7)
0 Karma

basics
Explorer

I had a typo and it works now.

However, couple more questions because I cannot do:

  • Group by DepartmentName, ProductName, Count

how do I do that?

 

0 Karma

to4kawa
Ultra Champion

your query

| stats count by DepartmentName, ProductName


0 Karma

to4kawa
Ultra Champion

If your log has both productID and userID field, your query will run.
If there aren't these, you should provide more details.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...