All Apps and Add-ons

postprocess - dashboard display

hqw
Path Finder

Hi all,

I want to use post process to speed up my dashboard, but face some problem to display out my result in the sub search. Can any one kindly tell me what is wrong? why can't i see any data ?

my base search:
<search id="1">
<![CDATA[*** | eval day=strftime(_time, "%Y-%m-%d") | rex field=_raw "server_name\=\"(?<retailer>([a-zA-Z]+)|(\d-\d+\s+))" | stats sum(touch_count) as sum_touch_count by day, retailer]]>

my sub search:
&lt;search base="1"&gt;
chart dc(server_name) AS "Distinct_Count_server", sum(sum_touch_count) AS sum_touch_count over day by retailer |eval avg= sum_touch_count/Distinct_Count_server |eval avg=round(avg,0)

what i want is to display average by retailers over time, but currently i just can get the result of server count and sum of interaction count by retail over time. Is there any requirement to add anything else behind my current sub search?

Thanks in advance.

0 Karma
1 Solution

alacercogitatus
SplunkTrust
SplunkTrust

The problem is that your subsearch is trying to use fields that are presented from the base search. A stats command will remove the fields presented to the next command, so you are trying to count server_name, but that isn't listed as an output field of the base search. You can try using eventstats to calculate the sum_touch_count.

<search id="1"><query><![CDATA[*** | eval day=strftime(_time, "%Y-%m-%d") | rex field=_raw "server_name\=\"(?<retailer>([a-zA-Z]+)|(\d-\d+\s+))" | eventstats sum(touch_count) as sum_touch_count by day, retailer]]></query></search>

<search base="1><query>chart dc(server_name) AS "Distinct_Count_server", latest(sum_touch_count) AS sum_touch_count over day by retailer |eval avg= sum_touch_count/Distinct_Count_server |eval avg=round(avg,0)

View solution in original post

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

The problem is that your subsearch is trying to use fields that are presented from the base search. A stats command will remove the fields presented to the next command, so you are trying to count server_name, but that isn't listed as an output field of the base search. You can try using eventstats to calculate the sum_touch_count.

<search id="1"><query><![CDATA[*** | eval day=strftime(_time, "%Y-%m-%d") | rex field=_raw "server_name\=\"(?<retailer>([a-zA-Z]+)|(\d-\d+\s+))" | eventstats sum(touch_count) as sum_touch_count by day, retailer]]></query></search>

<search base="1><query>chart dc(server_name) AS "Distinct_Count_server", latest(sum_touch_count) AS sum_touch_count over day by retailer |eval avg= sum_touch_count/Distinct_Count_server |eval avg=round(avg,0)
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!

Event Series: The Agentic SOC: Trust Before Autonomy

AI is fundamentally changing security operations, but true progress requires more than just automation—it ...

Free Professional Services for .conf26 Attendees

This year at .conf26, we are doing something a little different. We are bringing the best minds from ...

Defend at Machine Speed: Your Guide to Security Sessions at .conf26

Splunk .conf26   With threats moving at machine speed and attack surfaces expanding across hybrid ...