Hi guys,
I need to create a join with a row, and this row has multiple occurrences in another table. What is the best way to do this?
Thanks!
Like this:
(index=indexA sourcetype=sourcetypeA) OR (index=indexB sourcetype=sourcetypeB) | stats values(*) AS * BY MyCommonField
Can you please include a couple of each "side" of the events that need to be joined together? And how do they fit together?
I'll also mention that it's pretty rare to actually need join
itself, there is usually a much faster, easier method.
For instance,
sourcetype=A OR sourcetype=B | stats list(_raw) by MyCommonField
Now that's a terrible example because you likely don't want to list(_raw)
in the output, but it is nevertheless an example. 🙂
It would pull up all events that match either sourcetype (think SQL union), then the stats command would essentially group them together by the common field, whatever that is, doing what most folks consider a "join".