<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Splunk panel taking 20 seconds to load, but the inspect says &amp;quot;.7 seconds&amp;quot; in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619125#M14382</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note this is very long and complex. So if you don't have a suggestion, don't worry.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are using metric data.&lt;/P&gt;&lt;P&gt;Below is the 2 base search, then in each pannel I call base search 2 and filter or display what is needed.&lt;/P&gt;&lt;P&gt;The initial saved search is this, this is inside the first basesearch. But it all runs in .7 seconds, it's not the search that is slow. It is when I am trying to display it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| savedsearch Process_Data_Pull_v12_Report mx_env="dell730srv.fr.murex.com:15022" BPC_VALUE_TOKEN="*"&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mstats prestats=t latest("mx.process.errors.status") latest("mx.replica.status") latest("mx.process.resources.status") WHERE "index"="murex_metrics" AND mx.env=dell730srv.fr.murex.com:15022 BY service.name replica.name service.type parent.name 
| eval threshold="", pid="", cmd="", "host"="", "component.name"="" 
| mstats append=t prestats=t latest("mx.process.memory.usage") latest("mx.process.up.time") latest("mx.process.creation.time") WHERE "index"="murex_metrics" AND mx.env=dell730srv.fr.murex.com:15022 BY pid cmd service.type host service.name replica.name component.name threshold parent.name 
| rename "service.name" as service_name 
| rename "replica.name" as replica_name 
| rename "service.type" as service_type 
| stats latest("mx.process.errors.status") as Health latest("mx.process.resources.status") as Resources latest("mx.process.up.time") as upTime latest("mx.process.creation.time") as creationTime latest("mx.replica.status") as Replica latest("mx.process.memory.usage") as memoryCons by pid cmd service_type host service_name replica_name component.name threshold parent.name 
| eval T_MemoryCons=if(isnull(memoryCons),"",threshold), Process_Name=((service_name . " # ") . replica_name) 
| sort 0 Process_Name 
| streamstats first(Replica) as Replica first(Resources) as Resources first(Health) as Health by Process_Name 
| stats values(Health) as Health values(Resources) as Resources values(Replica) as Replica values(memoryCons) as memoryCons values(upTime) as upTime values(creationTime) as creationTime by pid cmd Process_Name service_type host service_name replica_name component.name parent.name 
| eval Replica=case((Process_Name == "xmlserver # xmlserver"),"2",(Process_Name == "zookeeper # zookeeper"),"2",(Process_Name == "fileserver # fileserver"),"2",true(),Replica) 
| where (cmd != "") 
| dedup pid 
| sort 0 - pid 
| eval Resources=if(match(Resources,"^[\\d\\.]*$"),floor(Resources),Resources) 
| eval Replica=if(match(Replica,"^[\\d\\.]*$"),floor(Replica),Replica) 
| dedup pid 
| join type=left pid 
    [| mstats latest("mx.process.cpu.utilization") as cpuPerc WHERE "index"="murex_metrics" AND mx.env=dell730srv.fr.murex.com:15022 span=10s GroupBY pid 
    | table _time pid 
    | chart sparkline(count) AS "PID_PULSE" count AS Total BY pid] 
| eval sparkdata=PID_PULSE 
| makemv delim="," PID_PULSE 
| rex field=sparkdata mode=sed "s/^ [ ^,]+,//" 
| eval sparkdata=split(sparkdata,",") 
| eval mvcount=mvcount(sparkdata) 
| eval firstHalf=mvindex(sparkdata,0,floor((mvcount / 2))) 
| eval firstHalfCountNonZero=mvcount(mvfilter((firstHalf &amp;gt; 0))) 
| eval firstHalfCountNonZero=if(isnull(firstHalfCountNonZero),0,firstHalfCountNonZero) 
| eval lastHalf=mvindex(sparkdata,ceil((mvcount / 2)),mvcount) 
| eval lastHalfCountNonZero=mvcount(mvfilter((lastHalf &amp;gt; 0))) 
| eval lastHalfCountNonZero=if(isnull(lastHalfCountNonZero),0,lastHalfCountNonZero) 
| eval Pulse=case(((firstHalfCountNonZero == 0) AND (lastHalfCountNonZero &amp;gt; 0)),"STARTING",((firstHalfCountNonZero &amp;gt; 0) AND (lastHalfCountNonZero == 0)),"DEAD",((firstHalfCountNonZero &amp;gt; 0) AND (lastHalfCountNonZero &amp;gt; 0)),"ALIVE") 
| sort upTime 
| eval creationTime=strftime(creationTime,"%y/%m/%d %H:%M:%S") 
| eval upTime=round(upTime,0) 
| eval upTime=tostring(upTime,"duration") 
| rename pid as PID, cmd as Type, "host" as MachineName 
| fillnull Pulse value="DEAD" 
| fillnull 
| append 
    [| mstats prestats=t latest("mx.replica.status") WHERE "index"="murex_metrics" AND mx.env=dell730srv.fr.murex.com:15022 BY service.name replica.name service.type 
    | mstats append=t prestats=t latest("mx.process.cpu.utilization") WHERE "index"="murex_metrics" AND mx.env=dell730srv.fr.murex.com:15022 BY pid cmd service.type host service.name replica.name component.name threshold 
    | fillnull 
    | rename "service.name" as service_name 
    | rename "replica.name" as replica_name 
    | rename "service.type" as service_type 
    | stats latest("mx.replica.status") as Replica latest("mx.process.cpu.utilization") as cpuPerc by pid cmd service_type host service_name replica_name component.name threshold 
    | eval Process_Name=((service_name . " # ") . replica_name) 
    | stats dc(pid) AS pid2 values(*) AS * BY Process_Name 
    | where pid=0 
    | rename pid as PID 
    | eval Replica=substr(Replica, 1, len(Replica)-7) 
    | table PID Process_Name service_name replica_name service_type Replica 
    | eval PID=if(PID=0,N/A,$PID$)] 
| rename service_type as Service_type 
| fillnull value="N/A" 
| join service_name 
    [| mstats latest(mx.service.dependencies.status) as Dependencies_x WHERE "index"="murex_metrics" AND mx.env=dell730srv.fr.murex.com:15022 AND used.by="***" BY "service.name" used.by 
    | dedup service.name 
    | rename service.name as service_name,service.type as Service_Type]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; &amp;lt;search id="basesearch_Process"&amp;gt;
    &amp;lt;!--Below base search is used for process view--&amp;gt;
    &amp;lt;query&amp;gt;

	| savedsearch Process_Data_Pull_v12_Report mx_env="$host_token$" BPC_VALUE_TOKEN="$BPC_VALUE_TOKEN$"


	&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;-80s&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
    &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
    &amp;lt;refresh&amp;gt;$Refresh_Token$&amp;lt;/refresh&amp;gt;
    &amp;lt;refreshType&amp;gt;delay&amp;lt;/refreshType&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;!--The main BASE SEARCH of THE VES--&amp;gt;
  &amp;lt;search base="basesearch_Process" id="basesearch_Process2"&amp;gt;
    &amp;lt;query&amp;gt; | join replica_name type=left [
   | mstats latest("mx.replica.restarts") as restartsNb WHERE mx.env="hp742srv.scz.murex.com:24000" AND "index"="murex_metrics" span=10s BY "replica.name" restartable host
| sort - _time
| dedup replica.name
| rename replica.name as replica_name
| sort - restartsNb
   ]
   | fillnull restartsNb value=-1
   | fillnull restartable value="N/A"
		
	| eval allFields=" ".PID." # ".Process_Name." # ".Service_type." # ".Type." # ".MachineName." " ``` mx.replica.status by services name are all the Launcher_based services 0=Down, 1=Not Ready and 2=Ready ``` 
	```Create a search string```
		 
	```Change the status of the xmlserver + zookeeper + fileserver to 4 = OK```
	| eval Replica=case((Process_Name == "xmlserver # xmlserver"),"4",(Process_Name == "zookeeper # zookeeper"),"4",(Process_Name == "fileserver # fileserver"),"4",true(),Replica) 

	```Change Status 0 to 6 for the sort, so it comes out at the bottom```

	| sort Pulse 
	 | eval restarts=if(restartsNb &amp;amp;gt; 0,1,4)
	 | eval restartsNb=round(restartsNb,0)
 | eval restartsNb=if(restartsNb == -1, "N/A", restartsNb)
 | rename restartsNb as total-restarts
 | rename restartable as auto-restart
	```Change Status 6 back to 0 this will go to NA as the sort is over for the sort, so it comes out at the bottom```
| eval global_status=min(Resources,Replica,Health,restarts)
	| eval Resources=case(Resources=2,"UNKNOWN",Resources="1","KO",Resources=3,"DEGRADED",Resources="4","OK",1=1,"N/A") 
	| eval Replica=case(Replica=2,"UNKNOWN",Replica="1","KO",Replica=3,"DEGRADED",Replica="4","OK",1=1,"N/A") 
	| eval Health=case((Health == 2),"UNKNOWN",(Health == "1"),"KO",(Health == 3),"DEGRADED",(Health == "4"),"OK",true(),"N/A") 


	| table _time, allFields, Process_Name, PID, creationTime, PID_PULSE, Pulse, Replica, Resources, Health,  replica_index, Service_type,"component.name", total-restarts, auto-restart, Type, MachineName ,  memoryCons upTime,  cpuPerc, T_CpuPerc, nbOfOpenFiles, T_NbOfOpenFiles, nbOfThreads, T_NbOfThreads,  memoryPerc, T_memoryPerc,  diskIoRate T_diskIoRate service_name, replica_name, service_name, replica_name parent.name global_status config.path

	```Display the Ant Tasks or NOT```
	| search Process_Name != "*$TOKEN_ANT_VALUE$*"  | search PID="$process_filter_token$" 
	| search allFields = "*$Processes_source_search_token2$*" AND service_name="$ServiceName_token_From_Service_Click$" AND replica_name="$ReplicaName_token$" AND Process_Name = "*$Launcher_name_token$"

	| search Service_type IN ($servicesTypeToken$) 
	| search Type IN ($TypeToken$) 
	| where PID != "$TOKEN_REPLICAS_NO_PROCESS$"	
	| eval temp=split(service_name,"#")  ```The launcher have a double name X # X below code removes the second copy, it should only be used for launchers as they are the ones with the pattern X # X , The launcher based can have a tripple name we only want 2 parts of it ``` 
	| eval service_nameA=mvindex(temp,0) 
	| eval service_nameB=mvindex(temp,1) 
	| eval Process_Name = if(Service_type="launcher",service_name,if(Service_type="launcher-based",service_nameA." # ".replica_name,if(Service_type="agent-based",service_name." # ".replica_name,service_name )))	
		
	 &amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;set token="Token_0_TRAP_1"&amp;gt;SET&amp;lt;/set&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Nov 2022 14:49:38 GMT</pubDate>
    <dc:creator>robertlynch2020</dc:creator>
    <dc:date>2022-11-01T14:49:38Z</dc:date>
    <item>
      <title>Splunk panel taking 20 seconds to load, but the inspect says ".7 seconds"?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619095#M14366</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I have a Splunk panel that takes ~20 seconds to load, but when I click on the inspect it tells me it took .7 seconds to load.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="robertlynch2020_0-1667299712923.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22258i48DD0BAC4FF36DD2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="robertlynch2020_0-1667299712923.png" alt="robertlynch2020_0-1667299712923.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="robertlynch2020_1-1667299734209.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22259iCF7C52786683225C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="robertlynch2020_1-1667299734209.png" alt="robertlynch2020_1-1667299734209.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;When I pull it out to just SPL it does run fast, it is just the final visualization that seems to take extra time in the Splunk pannel. Is there anything I can do here or a way to monitor this? OR how do I fix the lag?&lt;/P&gt;
&lt;P&gt;For information, I am running Splunk 8.1 on one SH with 3 Indexers.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="robertlynch2020_2-1667299839338.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22260iB1E7973B253E61E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="robertlynch2020_2-1667299839338.png" alt="robertlynch2020_2-1667299839338.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;To add once it is loaded it works fine - its just the initial load that is very slow&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 14:49:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619095#M14366</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2022-11-01T14:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk panel taking 20 seconds to load, but the inspect says ".7 seconds"</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619103#M14371</link>
      <description>&lt;P&gt;I suspect most of the time is consumed by the browser building the visualization.&amp;nbsp; To fix that, consider rewriting the dashboard using Splunk UI (React).&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 13:38:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619103#M14371</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-11-01T13:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk panel taking 20 seconds to load, but the inspect says ".7 seconds"</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619109#M14374</link>
      <description>&lt;P&gt;How are you generating the multivalued filters for services_type and type? Are you using base searches in the dashboard?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 13:55:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619109#M14374</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-11-01T13:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk panel taking 20 seconds to load, but the inspect says ".7 seconds"</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619115#M14376</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Yes, I use 2 base search .&lt;/P&gt;&lt;P&gt;One base search for the initial data pull.&lt;/P&gt;&lt;P&gt;Then a second base search to refine the data filters etc.. so we don't have to keep re-running the initial data pull if something is changed.&amp;nbsp; I have used this before on many dashboards, but this is the first where is it so slow to load.&lt;/P&gt;&lt;P&gt;However, to test this out - I removed all the base searches and put the code directly into the panel and it now works super quickly... This is a bit disappointing as I thought using base search in this structured way was a good way to reduce code replication, but in the end, if I have to put the code into all the panels if I want fast pannels it can become difficult to update a dashboard easily.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to get around this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 14:22:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619115#M14376</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2022-11-01T14:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk panel taking 20 seconds to load, but the inspect says ".7 seconds"</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619122#M14380</link>
      <description>&lt;P&gt;If you're willing to provide the query of the base searches, i'll be happy to help optimize it.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 14:41:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619122#M14380</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-11-01T14:41:00Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk panel taking 20 seconds to load, but the inspect says ".7 seconds"</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619125#M14382</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note this is very long and complex. So if you don't have a suggestion, don't worry.&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are using metric data.&lt;/P&gt;&lt;P&gt;Below is the 2 base search, then in each pannel I call base search 2 and filter or display what is needed.&lt;/P&gt;&lt;P&gt;The initial saved search is this, this is inside the first basesearch. But it all runs in .7 seconds, it's not the search that is slow. It is when I am trying to display it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| savedsearch Process_Data_Pull_v12_Report mx_env="dell730srv.fr.murex.com:15022" BPC_VALUE_TOKEN="*"&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| mstats prestats=t latest("mx.process.errors.status") latest("mx.replica.status") latest("mx.process.resources.status") WHERE "index"="murex_metrics" AND mx.env=dell730srv.fr.murex.com:15022 BY service.name replica.name service.type parent.name 
| eval threshold="", pid="", cmd="", "host"="", "component.name"="" 
| mstats append=t prestats=t latest("mx.process.memory.usage") latest("mx.process.up.time") latest("mx.process.creation.time") WHERE "index"="murex_metrics" AND mx.env=dell730srv.fr.murex.com:15022 BY pid cmd service.type host service.name replica.name component.name threshold parent.name 
| rename "service.name" as service_name 
| rename "replica.name" as replica_name 
| rename "service.type" as service_type 
| stats latest("mx.process.errors.status") as Health latest("mx.process.resources.status") as Resources latest("mx.process.up.time") as upTime latest("mx.process.creation.time") as creationTime latest("mx.replica.status") as Replica latest("mx.process.memory.usage") as memoryCons by pid cmd service_type host service_name replica_name component.name threshold parent.name 
| eval T_MemoryCons=if(isnull(memoryCons),"",threshold), Process_Name=((service_name . " # ") . replica_name) 
| sort 0 Process_Name 
| streamstats first(Replica) as Replica first(Resources) as Resources first(Health) as Health by Process_Name 
| stats values(Health) as Health values(Resources) as Resources values(Replica) as Replica values(memoryCons) as memoryCons values(upTime) as upTime values(creationTime) as creationTime by pid cmd Process_Name service_type host service_name replica_name component.name parent.name 
| eval Replica=case((Process_Name == "xmlserver # xmlserver"),"2",(Process_Name == "zookeeper # zookeeper"),"2",(Process_Name == "fileserver # fileserver"),"2",true(),Replica) 
| where (cmd != "") 
| dedup pid 
| sort 0 - pid 
| eval Resources=if(match(Resources,"^[\\d\\.]*$"),floor(Resources),Resources) 
| eval Replica=if(match(Replica,"^[\\d\\.]*$"),floor(Replica),Replica) 
| dedup pid 
| join type=left pid 
    [| mstats latest("mx.process.cpu.utilization") as cpuPerc WHERE "index"="murex_metrics" AND mx.env=dell730srv.fr.murex.com:15022 span=10s GroupBY pid 
    | table _time pid 
    | chart sparkline(count) AS "PID_PULSE" count AS Total BY pid] 
| eval sparkdata=PID_PULSE 
| makemv delim="," PID_PULSE 
| rex field=sparkdata mode=sed "s/^ [ ^,]+,//" 
| eval sparkdata=split(sparkdata,",") 
| eval mvcount=mvcount(sparkdata) 
| eval firstHalf=mvindex(sparkdata,0,floor((mvcount / 2))) 
| eval firstHalfCountNonZero=mvcount(mvfilter((firstHalf &amp;gt; 0))) 
| eval firstHalfCountNonZero=if(isnull(firstHalfCountNonZero),0,firstHalfCountNonZero) 
| eval lastHalf=mvindex(sparkdata,ceil((mvcount / 2)),mvcount) 
| eval lastHalfCountNonZero=mvcount(mvfilter((lastHalf &amp;gt; 0))) 
| eval lastHalfCountNonZero=if(isnull(lastHalfCountNonZero),0,lastHalfCountNonZero) 
| eval Pulse=case(((firstHalfCountNonZero == 0) AND (lastHalfCountNonZero &amp;gt; 0)),"STARTING",((firstHalfCountNonZero &amp;gt; 0) AND (lastHalfCountNonZero == 0)),"DEAD",((firstHalfCountNonZero &amp;gt; 0) AND (lastHalfCountNonZero &amp;gt; 0)),"ALIVE") 
| sort upTime 
| eval creationTime=strftime(creationTime,"%y/%m/%d %H:%M:%S") 
| eval upTime=round(upTime,0) 
| eval upTime=tostring(upTime,"duration") 
| rename pid as PID, cmd as Type, "host" as MachineName 
| fillnull Pulse value="DEAD" 
| fillnull 
| append 
    [| mstats prestats=t latest("mx.replica.status") WHERE "index"="murex_metrics" AND mx.env=dell730srv.fr.murex.com:15022 BY service.name replica.name service.type 
    | mstats append=t prestats=t latest("mx.process.cpu.utilization") WHERE "index"="murex_metrics" AND mx.env=dell730srv.fr.murex.com:15022 BY pid cmd service.type host service.name replica.name component.name threshold 
    | fillnull 
    | rename "service.name" as service_name 
    | rename "replica.name" as replica_name 
    | rename "service.type" as service_type 
    | stats latest("mx.replica.status") as Replica latest("mx.process.cpu.utilization") as cpuPerc by pid cmd service_type host service_name replica_name component.name threshold 
    | eval Process_Name=((service_name . " # ") . replica_name) 
    | stats dc(pid) AS pid2 values(*) AS * BY Process_Name 
    | where pid=0 
    | rename pid as PID 
    | eval Replica=substr(Replica, 1, len(Replica)-7) 
    | table PID Process_Name service_name replica_name service_type Replica 
    | eval PID=if(PID=0,N/A,$PID$)] 
| rename service_type as Service_type 
| fillnull value="N/A" 
| join service_name 
    [| mstats latest(mx.service.dependencies.status) as Dependencies_x WHERE "index"="murex_metrics" AND mx.env=dell730srv.fr.murex.com:15022 AND used.by="***" BY "service.name" used.by 
    | dedup service.name 
    | rename service.name as service_name,service.type as Service_Type]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; &amp;lt;search id="basesearch_Process"&amp;gt;
    &amp;lt;!--Below base search is used for process view--&amp;gt;
    &amp;lt;query&amp;gt;

	| savedsearch Process_Data_Pull_v12_Report mx_env="$host_token$" BPC_VALUE_TOKEN="$BPC_VALUE_TOKEN$"


	&amp;lt;/query&amp;gt;
    &amp;lt;earliest&amp;gt;-80s&amp;lt;/earliest&amp;gt;
    &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
    &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
    &amp;lt;refresh&amp;gt;$Refresh_Token$&amp;lt;/refresh&amp;gt;
    &amp;lt;refreshType&amp;gt;delay&amp;lt;/refreshType&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;!--The main BASE SEARCH of THE VES--&amp;gt;
  &amp;lt;search base="basesearch_Process" id="basesearch_Process2"&amp;gt;
    &amp;lt;query&amp;gt; | join replica_name type=left [
   | mstats latest("mx.replica.restarts") as restartsNb WHERE mx.env="hp742srv.scz.murex.com:24000" AND "index"="murex_metrics" span=10s BY "replica.name" restartable host
| sort - _time
| dedup replica.name
| rename replica.name as replica_name
| sort - restartsNb
   ]
   | fillnull restartsNb value=-1
   | fillnull restartable value="N/A"
		
	| eval allFields=" ".PID." # ".Process_Name." # ".Service_type." # ".Type." # ".MachineName." " ``` mx.replica.status by services name are all the Launcher_based services 0=Down, 1=Not Ready and 2=Ready ``` 
	```Create a search string```
		 
	```Change the status of the xmlserver + zookeeper + fileserver to 4 = OK```
	| eval Replica=case((Process_Name == "xmlserver # xmlserver"),"4",(Process_Name == "zookeeper # zookeeper"),"4",(Process_Name == "fileserver # fileserver"),"4",true(),Replica) 

	```Change Status 0 to 6 for the sort, so it comes out at the bottom```

	| sort Pulse 
	 | eval restarts=if(restartsNb &amp;amp;gt; 0,1,4)
	 | eval restartsNb=round(restartsNb,0)
 | eval restartsNb=if(restartsNb == -1, "N/A", restartsNb)
 | rename restartsNb as total-restarts
 | rename restartable as auto-restart
	```Change Status 6 back to 0 this will go to NA as the sort is over for the sort, so it comes out at the bottom```
| eval global_status=min(Resources,Replica,Health,restarts)
	| eval Resources=case(Resources=2,"UNKNOWN",Resources="1","KO",Resources=3,"DEGRADED",Resources="4","OK",1=1,"N/A") 
	| eval Replica=case(Replica=2,"UNKNOWN",Replica="1","KO",Replica=3,"DEGRADED",Replica="4","OK",1=1,"N/A") 
	| eval Health=case((Health == 2),"UNKNOWN",(Health == "1"),"KO",(Health == 3),"DEGRADED",(Health == "4"),"OK",true(),"N/A") 


	| table _time, allFields, Process_Name, PID, creationTime, PID_PULSE, Pulse, Replica, Resources, Health,  replica_index, Service_type,"component.name", total-restarts, auto-restart, Type, MachineName ,  memoryCons upTime,  cpuPerc, T_CpuPerc, nbOfOpenFiles, T_NbOfOpenFiles, nbOfThreads, T_NbOfThreads,  memoryPerc, T_memoryPerc,  diskIoRate T_diskIoRate service_name, replica_name, service_name, replica_name parent.name global_status config.path

	```Display the Ant Tasks or NOT```
	| search Process_Name != "*$TOKEN_ANT_VALUE$*"  | search PID="$process_filter_token$" 
	| search allFields = "*$Processes_source_search_token2$*" AND service_name="$ServiceName_token_From_Service_Click$" AND replica_name="$ReplicaName_token$" AND Process_Name = "*$Launcher_name_token$"

	| search Service_type IN ($servicesTypeToken$) 
	| search Type IN ($TypeToken$) 
	| where PID != "$TOKEN_REPLICAS_NO_PROCESS$"	
	| eval temp=split(service_name,"#")  ```The launcher have a double name X # X below code removes the second copy, it should only be used for launchers as they are the ones with the pattern X # X , The launcher based can have a tripple name we only want 2 parts of it ``` 
	| eval service_nameA=mvindex(temp,0) 
	| eval service_nameB=mvindex(temp,1) 
	| eval Process_Name = if(Service_type="launcher",service_name,if(Service_type="launcher-based",service_nameA." # ".replica_name,if(Service_type="agent-based",service_name." # ".replica_name,service_name )))	
		
	 &amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;set token="Token_0_TRAP_1"&amp;gt;SET&amp;lt;/set&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 14:49:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619125#M14382</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2022-11-01T14:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk panel taking 20 seconds to load, but the inspect says ".7 seconds"</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619165#M14387</link>
      <description>&lt;P&gt;Wow, you did provide fair warning, there's a lot to unwind here. Just on a high level, the very generous use of multiple append and joins forces the search and processing to occur in a certain sequential order which is likely the cause of the delay.&lt;/P&gt;&lt;P&gt;In particular, the join in your base search 2 would the first I would focus on. When using a join, the subsearch actually runs before the main search. See if this is the issue by deleting the join in your 2nd search and see how it impacts performance.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Nov 2022 16:46:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Splunk-panel-taking-20-seconds-to-load-but-the-inspect-says-quot/m-p/619165#M14387</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-11-01T16:46:55Z</dc:date>
    </item>
  </channel>
</rss>

