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
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...