Fields disappear from result set

General Question

I have a test query, working with the stdDev function:

#event_simpleName = NetworkRecieveAcceptIP4
groupBy([ComputerName], function=count(as="connect_count"))
stdDev("connect_count", as="stddev")

When I run this query, the fields ComputerName and connect_count disappear, leaving only the stddev value. They are completely gone from the result set. Is there something wrong with the stdDev function or am I doing something wrong?

Posted Apr 29, 2025, 2:44 PM UTC

13
Andrew-CSCS ENGINEER•

Hi there. You can't determine the standard deviation against a single count value. This is an example of how you might find the standard deviation by day:

#event_simpleName=NetworkRecieveAcceptIP4
| Day:=formatTime(format="%F", field="@timestamp")
| groupBy([ComputerName, Day])
| groupBy([ComputerName], function=([max(_count), min(_count), avg(_count), stdDev("_count")]))
| round("_max") | round("_min") | round("_avg") | round("_stddev")
1
Mr-RotsOP•

I tried putting the call to stdDev in the groupBy function parameter, but it always got a value of 0, so I didn't think that was the right place. I will try again

1
Oscar_Geare•
#event_simpleName=“NetworkRecieveAcceptIP4”
| groupBy([ComputerName], 
    function=[
        count(as="connect_count")),
        stdDev("connect_count", as="stddev")
    ]
)
1