Splunk Search

The same sql but different searche result

kavana
Explorer

The SPL below was ran in search bar and table in panel, but the search result are different.

Why the same SPL made different result?


source="after.csv" host="CDC311241" index="fuji_xerox_zhuwenbin" sourcetype="csv" "商談コード"=1410001001

|rename "ステータス" as status |dedup status

|eval process=if(status=="XXMB_ACTIVE","OK","NG")

|stats count(eval(process="OK")) AS OK,count(eval(process="NG")) AS NG BY "商談コード"

|eval porcessmid = if(OK>0 AND NG=0,"OK","NG")|table porcessmid

|append[search source="onetime.csv" host="CDC311241" index="fuji_xerox_zhuwenbin" sourcetype="csv" "商談コード"=1410001001

|rename "注文日" as chumonbi

|eval porcessmid = if(isnull(chumonbi),"NG","OK")

|table porcessmid]

|stats count(eval(porcessmid="OK")) AS OK,count(eval(porcessmid="NG")) AS NG

|eval processend = if(NG>0,"NG",if(OK>0,"OK","NG"))
|table processend

        |rename "契約連番" as aftercontractno,"取引番号" as torihikino|eval version =2  
        |JOIN type=inner aftercontractno version[search source="after.csv" host="CDC311241" index="fuji_xerox_zhuwenbin" sourcetype="csv" "商談コード"=1410001001  
        |rename "個別契約連番" as aftercontractno|eval version=2] |eval MB=substr(torihikino,0,2)     
        |eval process = if(MB=="MB","OK","NG") |appendpipe [stats count | eval process = "OK" | eval somecolumn = 0 | where count==0] |table process    
        |append[search source="seikyuzumi_code.csv" host="CDC311241" index="1012test" sourcetype="csv"  
        |rename "契約連番" as aftercontractno,"発行F" as excuteflag   
        |JOIN type=inner aftercontractno [search source="after.csv" host="CDC311241" index="fuji_xerox_zhuwenbin" sourcetype="csv" "商談コード"=1410001001     
        |rename "個別契約連番" as aftercontractno|eval version=2  
        |JOIN type=inner aftercontractno version[search source="afterrireki.csv" host="CDC311241" index="1012test" sourcetype="csv"     
        |rename rireki as version,"個別契約連番" as aftercontractno]]     
        |eval process = if(excuteflag=="1","OK","NG") |appendpipe [stats count  
        | eval process = "NG" |eval somecolumn = 0 | where count==0] |table process]    
        |stats count(eval(process="OK")) AS OK,count(eval(process="NG")) AS NG  
        |eval processend = if(NG>0,"NG",if(OK>0,"OK","NG")) |table processend]  
        |stats count(eval(processend="OK")) AS OK,count(eval(processend="NG")) AS NG    
        |eval processendTWO = if(NG>0,"NG",if(OK>0, "OK","NG"))     
        |table processendTWO |eval severity=case(processendTWO="OK", 5, processendTWO="NG", 50)     
        |rangemap field=severity low=1-30 elevated=31-39 default=severe 

Tags (1)
0 Karma

renjith_nair
Legend

You might need to give little more details like what are the differences in result etc.

Most probably, it has something to do with field extraction due to search mode. You might be executing the search in search bar with verbose mode where as in dashboard panel, it's smart mode by default.

You can verify this by opening the search result in search bar from table and see the difference

---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...