Splunk Search

timechart , streanstats Question

qfjp
Explorer
sourcetype=syslog | timechart span=1m count by Protocol | streamstats sum() avg()

The result of this query is as follows:
(Time fields have been omitted.)

17  2  6   avg(17)  avg(2)  avg(6)   sum(17)  sum(2)  sum(6)  
4   0  30  4.0000   0.0000  30.0000  4        0       30       
14  1  103 9.0000   0.5000  66.5000  18       1       133      
21  0  5   13.000   0.3333  46.0000  39       1       138      
22  1  0   15.250   0.5000  34.5000  61       2       138    
20  0  12  16.200   0.4000  30.0000  81       2       150      
11  1  32  15.333   0.5000  30.3333  92       3       182    


sourcetype=syslog | timechart span=1m count by Protocol 
| streamstats sum() avg()
| eval S/A=sum+avg

The results of this query as the table below and are stoked.
However, the results of the query does not appear.

17  2  6   avg(17)  avg(2)  avg(6)   sum(17)  sum(2)  sum(6)  S/A(17)  S/A(2)  S/A(6) 
4   0  30  4.0000   0.0000  30.0000  4        0       30      ?        ?       ?
14  1  103 9.0000   0.5000  66.5000  18       1       133     ?        ?       ?
21  0  5   13.000   0.3333  46.0000  39       1       138     ?        ?       ?
22  1  0   15.250   0.5000  34.5000  61       2       138     ?        ?       ?
20  0  12  16.200   0.4000  30.0000  81       2       150     ?        ?       ?
11  1  32  15.333   0.5000  30.3333  92       3       182     ?        ?       ?

How do you create a query?

Tags (2)
0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

Do what kkolb says. Fieldnames can't be "S/A", it needs to be s_a.

kristian_kolb
Ultra Champion

or "s_a". From the documentation;

  • Valid characters for field names are a-z, A-Z, 0-9, or _ .
  • Field names cannot begin with 0-9 or _ . Leading underscores are reserved for Splunk's internal variables.
  • International characters are not allowed.

yannK
Splunk Employee
Splunk Employee

can you clarify that is your goal ?

also S/A may not be a valid field name, try "S/A"

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!

Meet the .conf26 AI Agent Buildathon Winners

At the .conf26 AI Agent Buildathon, Splunk users turned their operational expertise into working AI agents ...

Trusted Autonomy in the SOC: A Maturity Journey

AI is compressing attacker timelines and pushing SOC teams beyond human capacity thresholds. The next SOC ...

Supercharging Windows Security Detection Performance: Introducing Hybrid Field ...

Windows event logs—from Security auditing and Sysmon to PowerShell script blocks—form the operational backbone ...