Splunk Search

How to find employee manager up to levels above until CEO using dbquery?

Explorer

I have a report that I run against Oracel db using dbquery to gather the following fields in a table
EMPLOYEEID ,EMPLOYEE FULL NAME, MANAGERID
2561, Mark Antony, 3560
3560, John Roberts , 210
210, Mathew Nathaniel, 6230
31, David Blan, 65

Need help to get an output like one below:-
EmployeeID, EMPLOYEE FULL NAME, MANAGERID LEVEL-1, MANAGER NAME LEVEL-1, MANAGERID LEVEL -2, MANAGER NAME LEVEL-2
2561, Mark Antony, 3560, John Roberts,210, Mathew Nathaniel

Tags (3)
0 Karma

Communicator

this is a recursion problem, and because it's unclear how many levels you'll need to go to, you should do it in two steps.

  1. index the data with a simple dbinput
  2. use a dbxlookup to figure out bosses for whoever shows up on the dashboard when you look at the data
0 Karma

Explorer

the actual data has up to 8 levels that is the maximum we have, for some like the CEO & certain staff will not have supervisor ID

0 Karma

Communicator

More than one level is assumed, no one really has a flat organization. It doesn't make any difference to my advice. Missing data is also normal, but not your problem. In fact your dashboard might even inspire people to start fixing the source data.

0 Karma
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!