{
  "comment" : "This is generated by ESQL's AbstractFunctionTestCase. Do not edit it. See ../README.md for how to regenerate it.",
  "type" : "time_series_agg",
  "name" : "last_over_time",
  "description" : "Calculates the latest value of a field, where recency determined by the `@timestamp` field.",
  "signatures" : [
    {
      "params" : [
        {
          "name" : "field",
          "type" : "counter_double",
          "optional" : false,
          "description" : "the metric field to calculate the latest value for"
        },
        {
          "name" : "window",
          "type" : "time_duration",
          "optional" : true,
          "description" : "the time window over which to find the latest value"
        }
      ],
      "variadic" : false,
      "returnType" : "double"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "counter_integer",
          "optional" : false,
          "description" : "the metric field to calculate the latest value for"
        },
        {
          "name" : "window",
          "type" : "time_duration",
          "optional" : true,
          "description" : "the time window over which to find the latest value"
        }
      ],
      "variadic" : false,
      "returnType" : "integer"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "counter_long",
          "optional" : false,
          "description" : "the metric field to calculate the latest value for"
        },
        {
          "name" : "window",
          "type" : "time_duration",
          "optional" : true,
          "description" : "the time window over which to find the latest value"
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "double",
          "optional" : false,
          "description" : "the metric field to calculate the latest value for"
        },
        {
          "name" : "window",
          "type" : "time_duration",
          "optional" : true,
          "description" : "the time window over which to find the latest value"
        }
      ],
      "variadic" : false,
      "returnType" : "double"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "exponential_histogram",
          "optional" : false,
          "description" : "the metric field to calculate the latest value for"
        },
        {
          "name" : "window",
          "type" : "time_duration",
          "optional" : true,
          "description" : "the time window over which to find the latest value"
        }
      ],
      "variadic" : false,
      "returnType" : "exponential_histogram"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "integer",
          "optional" : false,
          "description" : "the metric field to calculate the latest value for"
        },
        {
          "name" : "window",
          "type" : "time_duration",
          "optional" : true,
          "description" : "the time window over which to find the latest value"
        }
      ],
      "variadic" : false,
      "returnType" : "integer"
    },
    {
      "params" : [
        {
          "name" : "field",
          "type" : "long",
          "optional" : false,
          "description" : "the metric field to calculate the latest value for"
        },
        {
          "name" : "window",
          "type" : "time_duration",
          "optional" : true,
          "description" : "the time window over which to find the latest value"
        }
      ],
      "variadic" : false,
      "returnType" : "long"
    }
  ],
  "examples" : [
    "TS k8s\n| STATS max_cost=MAX(LAST_OVER_TIME(network.cost)) BY cluster, time_bucket = TBUCKET(1minute)"
  ],
  "preview" : true,
  "snapshot_only" : false
}
