Search code examples
fluxinfluxdb-2

Flux: How to get the last record for each value


Ok this have to be something easy, but I can not find out.

Y have the following table, obtained with flux:

table

Ok, I am monitoring Jira, and as you see, in the column "event_type" I have the creation and the following jiras updates. The target here is get the newest record from each "_value" column, I mean, each jira

Any idea about how to achieve this?

Thank you!


Solution

  • At first need to group by value and then just get last

    |> group(columns: ["_value"])
    |> last()