now the problem is when i am trying to run this query
SELECT
UNIX_TIMESTAMP(date_at) as time_sec,
Current as value,
‘Current’ as metric
FROM jobs
ORDER BY date_at
i am getting under the time_sec field somthing like this (1.52Bil) which is the a number in seconds i guess.
and when i am running the follwoing query
SELECT UNIX_TIMESTAMP(date_at) as time_sec, Current as value, ‘Current’ as metric FROM jobs WHERE $__timeFilter(date_at) ORDER BY date_at desc
so the graph is not showing the previous value of current. it shows just the last two points or values
my questions:
how i can show the different value of Current job as graph with lines and points change with changing the value of current and its timestamp in database.
2.how i can show the date of each value in readable form 2018-03-23 12:24:06 for example.
if i have multiple lines or records for Current job in my database with its corresponding timestamp how i can rewrite my query so i can show it like a line and point graph.
Please go to Column Styles tab and add time_sec to the Apply to columns named field, then change the Type to Date.
I don’t understand what you mean. Looks to me that you have no more data in the time range (upper right corner) you’ve selected. Can you provide something that visualizes what you’re trying to accomplish?
how i can change the date to the current date.
and how i can rewrite my query so i can get the value of Current , Finished , Pending ,Error jobs as columns in the table which will change whenever the time_sec column value will change.
Oh right. For the table panel you don’t need to adhere to columns named time_sec, value and metric - those are specific for time series queries and you should have read about that in the documentation.
Just do a
SELECT
date_at,
Current,
Finished,
Pending,
Error
FROM
jobs
WHERE
$__timeFilter(date_at)
Then you’ll need to adjust the column styles again for at least your date column which now is called date_at.
That’s a timezone issue. We strongly suggest that you write your dates in UTC to the database. If not, you can do some time zone conversion using for example this function.
One other thing you can try is to convert it to epoch: