I have a search based on an SQL query e.g. select * from . I would like to divide some data displayed on a field called 'Cost' by 2 and display result on the same field. I only have one row of data.
Thanks
add |eval Cost=Cost/2
after your SQL search
I did that but receive this error:
command="dbquery", A database error occurred: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '|eval Cost=Cost/2' at line 1.
The sql query works fine without the expression.
Can you give the whole syntax for your search? The |eval Cost=Cost/2 is a Splunk function and would need to exist outside of any dbquery commands.
I got it working. I had forgotten to put the SQL query in quotes. Thanks
Excellent! Please accept if the answer was helpful.