@gokikrishnan,
eval num_field = tostring(num_field)
Reference : tostring
I did the following
eval num_field = tostring(num_field)|stats num_field by Field.
It was working till tostring conversion. Throwing error if I use the stats command. The error as follows
Error in 'stats' command: The argument 'Field' is invalid.
for using stats
you need an aggregate function like , sum,max,min etc
If you could tell us your exact requirement, that might help
@gokikrishnan as stated by @renjith.nair the issue seems to be with your stats command rather than string conversion. Seems like you will not need string conversion in the first place. For the community to assist you better with your query it would be nice if you provide what is the kind of data you have and what is the output you need. You should check out Statistical aggregating functions to understand them better: https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonStatsFunctions#Supported_f...