I have a query From source A that i need to get a list of 3 parameters back and for one of these parameters which is a ID and i need to get the the actual name of the object from another query from source B using this ID. Eventually i need i want to create a table to print the 3 parameter including the name also. Any help would be greatly appreciated?
To receive help in Splunk search, it is best to give more concrete information, even if you use mock names and values.
Assuming the two different sources are sourcetype sourceA and sourceB. The 3 parameters in sourceA are named "ID", "param2", and "param3". Further assume that sourceB has the same field name "ID" to match that in sourceA, and that "actual name of the object" is in field named "name". Assuming that all these fields are already extracted.
sourcetype IN (sourceA, sourceB)
| stats values(name) as name values(param2) as param2 values(param3) as param3 by ID
Hi @momagic ,
you have to use a subsearch:
create a main query containing the data to display,
adding as subsearch (putting it between square brackets and adding the search command at the beginning) the search containing the parameters,
then you can display the fields you want.
You have to put attention to two things:
For example, if the fields to use to filter events are FieldA and FieldB but ib the subsearch there are also other fields, you should write:
index=index1 [ search index=index2 | fields FieldA FieldB ]
| table _time host field1 field2 FieldA FieldB
If you haven't much experience on Splunk searches and you didn't followed a course (there are many free courses in Splunk), you could follow the Splunk Search Tutorial (https://docs.splunk.com/Documentation/SplunkCloud/9.3.2408/SearchTutorial/WelcometotheSearchTutorial) that explain how to use Splunk for searching, and here you can find a description of how to use subsearches https://docs.splunk.com/Documentation/SplunkCloud/9.3.2408/SearchTutorial/Useasubsearch
Ciao.
Giuseppe
Ciao.
Giuseppe