Splunk Search

How to replace message "no result found" resulting to outputlookup

mah
Builder

Hi, 

I have to display on a dashboard the content of a lookup which is some time empty and so shows the message "no result found". 

My query is : 

index=A sourcetype="B" id=*
| table id name | outputlookup example.csv

How can I modify this message ? 

Labels (1)
Tags (1)
0 Karma

to4kawa
Ultra Champion

sample:

index=_internal sourcetype=splunk
| appendpipe 
    [| stats count 
    | eval msg="No event for this host" | where count=0 |table msg ]

There is only msg field.

<condition match="'result.msg' ==&quot;No event for this host&quot;">
    <set token="tables">msg</set> </condition>
<condition>
     <set token="tables">id,name,&quot;Start time&quot;,&quot;End time&quot;</set>
</condition>

Now, why don't you try using the token value as the | table argument?

 

0 Karma

mah
Builder

Sorry, I never set a condition ... So I try to understand : 

Here is my xml code with your solution : 

 

 

 

<table>
        <search>
          <query>index=A sourcetype="B" id=*
| table id name start end 
| sort - start
| appendpipe 
    [| stats count 
    | eval msg="No event for this table" | where count=0 |table $tables$ ]</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
          <finalized>
            <condition match="'result.msg' ==&quot;No event for this table&quot;">
            <set token="tables">msg</set> </condition>
            <condition>
            <set token="tables">id,name,start,end</set>
            </condition>
          </finalized>
          </search>
        <option name="count">20</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="refresh.display">progressbar</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>

 

 

 

But it is not working : still have the message "no results found"

0 Karma

mah
Builder

hi @to4kawa 

I saw this answer before I asked this question. The thing is that it gives me a table like that :

mah_0-1608798059157.png

And what I want if it is possible is just the message and not other empty cells. 

Is it possible ?

Tags (1)
0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

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

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...