I have a query to display following 3 fields
| table pp_user_action_name,Today_Calls,Avg_today
i want to replace 'Avg_today' column header with today's date like '11/1/2023'
is it possible?
Here's one method. There may be others.
| makeresults
| eval pp_user_action_name="foo",Today_Calls=42,Avg_today=3
| table pp_user_action_name,Today_Calls,Avg_today
| rename Avg_today as
[| makeresults
``` Get today's date and format it ```
| eval today=strftime(now(), "%m/%d/%Y")
``` Return only the value of the today field ```
| return $today]
Here's one method. There may be others.
| makeresults
| eval pp_user_action_name="foo",Today_Calls=42,Avg_today=3
| table pp_user_action_name,Today_Calls,Avg_today
| rename Avg_today as
[| makeresults
``` Get today's date and format it ```
| eval today=strftime(now(), "%m/%d/%Y")
``` Return only the value of the today field ```
| return $today]
its working. can we append any string with this date? For Ex: 11/1/2023_Response
Sure! Just use the concatenation operator (.) in the eval command.
| eval today=strftime(now(), "%m/%d/%Y") . "_Response"
Thanks. i am all set.