I am using inifinity-datasource where I am calling the Elasticsearch with some query and getting some result like below, I need to visualize this result using Timeseries panel (specially the key_as_string and value) but I am getting a message like “Data is missing a time field”,
First thing I did was create some dummy data based on your template in order to get some different values that could be plotted over time. I created 3 different values with 3 different dates (3-14, 3-15 3-16):
parse-json is the command to instruct the UQL to parse the response as JSON
project command is used to select the columns to include in the results. To select a property inside a nested object, I used dot notation (average_of_age.value).
extend command is similar to project but instead of selecting the columns, it adds/replaces columns in existing data and I also used the todatetime function to convert key_as_string so that it can be interpreted by Grafana as a date/time field.
project-away command is exactly opposite as project . It drops specific columns from the data. It doesn’t support alias or dot notation selector.
I have added this as although UQL is indeed very powerful it takes a lot of getting used to and sweat if you are not a dedicated programmer.
What many do not realise is that one may traverse the nested levels using the . operator.
In your case all data bar the value is not nested.
One may access it using average_of_age.value
Also when using UQL if time data is not correctly formatted then using the Time Series Chart it will throw errors until time is correctly formatted so it is best to start with using a Table Panel.