Hello,
I am trying to change the string type field to integer using CAST() by a query.
search source=index-yyyy-mm-dd | eval userID=cast(userID as int) | fields userID
but I am receiving error as follow.
{
“error”: {
“reason”: “Invalid Query”,
“details”: “Failed to parse query due to offending symbol [(] at: ‘source=index-yyyy-mm-dd | eval userID=cast(’ <— HERE… More details: Expecting tokens in {, ‘|’, ‘,’, ‘.’, ‘+’, ‘-’, ‘*’, ‘/’, ‘%’}”,
“type”: “SyntaxCheckException”
},
“status”: 400
}
Can someone pls guide where am I going wrong?