Splunk Search

Join two field with similar values and stats by an uncommon field

icosine
Engager

How do I combine a field with similar value (where one value might or might not exist in one of the field) and use stats by with an uncommon field? I have the search below 

| tstats prestats=t summariesonly=t allow_old_summaries=t count from datamodel=Network_Resolution.DNS by "DNS.query"
| rename DNS.query as query1
| tstats append=t prestats=t summariesonly=t allow_old_summaries=t count from datamodel=Web.Web by _time Web.dest Web.category
| rename Web.dest as query2
| rename Web.category as category
| eval query=coalesce(query1,query2)
| stats count by query category
| fillnull value=NULL

 

Web.destWeb.categoryDNS.query
abc.comNewsabc.com
  dfe.com

 

Results:

querycategory
abc.comnews

 

Expected Results:

querycategory
abc.comnews
dfe.comNULL
Labels (4)
0 Karma
1 Solution

to4kawa
Ultra Champion

...

| fillnull value=NULL
| stats count by query category

The order is important.

View solution in original post

0 Karma

to4kawa
Ultra Champion

...

| fillnull value=NULL
| stats count by query category

The order is important.

0 Karma

icosine
Engager

Omg thanks!

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

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 ...