Splunk Search

Sub-searches using savedsearch returns results, but columns are labeled "NULL"

yacht_rock
Explorer

Using savedsearch and timechart, I'm getting NULL where I'd expect the values of "myfield"

Base search (@m to -1h@h)

 index=myindex myfield=*FOO* | timechart span=1h count by myfield

And aggregating searches like

 | savedsearch mysavedsearch1 | timechart span=1d count by myfield

Aggregating search has time stamps in correct grouping, but the other column is labeled NULL when it should be values like myfield-foo, foo-myfield, etc..

0 Karma
1 Solution

somesoni2
Revered Legend

Once you fire your first query, the columns available are _time and value of myfield (not the column with name myfield). So when you're using your second search, it'll return NULL as there is no column with name myfield. This is how you should implement this

Base search (@m to -1h@h)

 index=myindex myfield=*FOO* | bucket span=1h _time | stats count by _time myfield

And aggregating searches like

| savedsearch mysavedsearch1 | timechart span=1d sum(count) by myfield

View solution in original post

somesoni2
Revered Legend

Once you fire your first query, the columns available are _time and value of myfield (not the column with name myfield). So when you're using your second search, it'll return NULL as there is no column with name myfield. This is how you should implement this

Base search (@m to -1h@h)

 index=myindex myfield=*FOO* | bucket span=1h _time | stats count by _time myfield

And aggregating searches like

| savedsearch mysavedsearch1 | timechart span=1d sum(count) by myfield
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...