The eval command in Splunk calculates an expression and puts the resulting value into a search results field. The eval command evaluates mathematical, string, and Boolean expressions.  In the scenario, where the field name mentioned by the user does not match a field in the output, a new field is added to the search results. On the other side, the field name mentioned by the user matches a field name that already exists in the search results, the results of the eval expression overwrite the values in that field.  The stats command calculates statistics based on fields in given events. The eval command creates new fields in events by using existing fields and an arbitrary expression.  Reference: Splunk Official Doc