Splunk Search

Joining entries using IDs

m_hunger
New Member

Hi,

I am trying to extract an ID from a search and append the results using the extracted ID.

Example:
Search: host="hostname" 32351
<190>Aug 15 11:28:02 hostname sshd[32351]: User child is on pid 32353

Now I would like to append the entries including the child pid, e.g.
Search: host="hostname" 32351 OR 32353 without having to type "OR 32353".

Here, Splunk adds all entries with all child pid's and not only those from the main search:
host="hostname" pid=32351 | append [search host="hostname" | fields + childpid]

So I am probably missing something before append. I hope it is enough information.

Tags (2)
0 Karma

m_hunger
New Member

At least it makes a correct connection, but I need the complete logentries.

What I basically need is:
SELECT * FROM sshd a, internal-sftp b WHERE a.pid="1000" AND a.childpid = b.pid;

0 Karma

kristian_kolb
Ultra Champion

see update above /k

0 Karma

Ayn
Legend

Did you look into using transaction?

0 Karma

kristian_kolb
Ultra Champion

If you have the field extractions for pid and childpid configured already, you could simply get the children of a pid by

host=hostname | stats values(childpid) by pid

UPDATE:

Hmm, not 100% sure I follow you, but...

host=hostname pid=12345 OR [search host=hostname pid=12345 | rename childpid as pid | fields + pid]

..something like this might work.

/k

Hope this helps,

Kristian

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...