- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
eval returns a field rather than a scalar
riley_lewis
Loves-to-Learn Lots
03-28-2024
05:43 AM
When I do this search:
index="mydata" | eval mymean=avg(floatnumbers) | table floatnumbers,mymean
mymean just mimics whatever is in floatnumbers. How do I calculate the mean? I have tried the fieldsummary command, but when I did that, it would not port to chart correctly.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

gcusello

SplunkTrust
03-28-2024
06:05 AM
Hi @riley_lewis,
the avg function must be used in a streaming command as stats or timechart:
index="mydata"
| stats avg(floatnumbers) AS floatnumbers BY mymean
Ciao.
Giuseppe
