Splunk Search

Why are eval fields not in table?

Span
Engager

Hi,

Iam trying a simple query where i want to see the percentage of calls with a particular response time in splunk and somehow the percent field is coming as empty in the table.

 

index = xyz http_status=200 | stats count(request_ms) as web-calls by request_ms | eventstats sum(web-calls) as totalwb |eval percent=(web-calls*100/totalwb) | table request_ms web-calls totalwb percent

Labels (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The problem is with the web-calls field name.  The eval command is computing percent as (web-(calls*100/totalweb)), but since the web and calls fields don't exist they can't be subtracted so the percent field can't be computed.  Percent is set to null and is displayed as an empty field.  This is why hyphens should not be used in field names.  If the hyphen can't be changed then surround the field name in single quotes ('web-calls') so Splunk knows it's a field rather than an expression.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

The problem is with the web-calls field name.  The eval command is computing percent as (web-(calls*100/totalweb)), but since the web and calls fields don't exist they can't be subtracted so the percent field can't be computed.  Percent is set to null and is displayed as an empty field.  This is why hyphens should not be used in field names.  If the hyphen can't be changed then surround the field name in single quotes ('web-calls') so Splunk knows it's a field rather than an expression.

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...