Vega-lite, create a forecast similar as lens visualization

Hello everyone
I have a question with vega-lite and I don't know how to follow up. I checked on lens I can see data from last 2 hours and next 4 hours on the same graphic (a forecast job has been launched previously to get that data), for example

but on vega lite if I try to do the same, using the request that is used on Lens, I´m not able to replicate that graphic (lens for aggs use percentiles and I use terms value)

this is the Lens request

{
  "aggs": {
    "0": {
      "date_histogram": {
        "field": "timestamp",
        "fixed_interval": "10m",
        "time_zone": "Europe/Madrid",
        "extended_bounds": {
          "min": 1674194400000,
          "max": 1674223519676
        }
      },
      "aggs": {
        "1": {
          "percentiles": {
            "field": "actual",
            "percents": [
              50
            ]
          }
        },
        "2": {
          "percentiles": {
            "field": "forecast_prediction",
            "percents": [
              50
            ]
          }
        }
      }
    }
  },
  "size": 0,
  "fields": [
    {
      "field": "bucket_influencers.timestamp",
      "format": "date_time"
    },
    {
      "field": "earliest_record_timestamp",
      "format": "date_time"
    },
    {
      "field": "exponential_average_calculation_context.latest_timestamp",
      "format": "date_time"
    },
    {
      "field": "forecast_create_timestamp",
      "format": "date_time"
    },
    {
      "field": "forecast_end_timestamp",
      "format": "date_time"
    },
    {
      "field": "forecast_expiry_timestamp",
      "format": "date_time"
    },
    {
      "field": "forecast_start_timestamp",
      "format": "date_time"
    },
    {
      "field": "last_data_time",
      "format": "date_time"
    },
    {
      "field": "latest_empty_bucket_timestamp",
      "format": "date_time"
    },
    {
      "field": "latest_record_time_stamp",
      "format": "date_time"
    },
    {
      "field": "latest_record_timestamp",
      "format": "date_time"
    },
    {
      "field": "latest_result_time_stamp",
      "format": "date_time"
    },
    {
      "field": "latest_sparse_bucket_timestamp",
      "format": "date_time"
    },
    {
      "field": "log_time",
      "format": "date_time"
    },
    {
      "field": "model_size_stats.log_time",
      "format": "date_time"
    },
    {
      "field": "model_size_stats.timestamp",
      "format": "date_time"
    },
    {
      "field": "timestamp",
      "format": "date_time"
    }
  ],
  "script_fields": {},
  "stored_fields": [
    "*"
  ],
  "runtime_mappings": {},
  "_source": {
    "excludes": []
  },
  "query": {
    "bool": {
      "must": [],
      "filter": [
        {
          "bool": {
            "should": [
              {
                "match_phrase": {
                  "partition_field_value": "hidden text"
                }
              }
            ],
            "minimum_should_match": 1
          }
        },
        {
          "range": {
            "timestamp": {
              "format": "strict_date_optional_time",
              "gte": "2023-01-20T06:00:00.000Z",
              "lte": "2023-01-20T14:05:19.676Z"
            }
          }
        }
      ],
      "should": [],
      "must_not": []
    }
  }
}

This is my current vega lite code (index field and partition_field_value have been modified due to are sensible information)

  • As I removed "%context%": true and "%timefield%": "timestamp" under URL, time filter doesn't works and it's defined the datetime under query - bool ...
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "title": "push notifications",
  "data": {
    "url": {
      "index": ".ml-anomalies-cxx-xxx_xxx_xxx_movil",
      "body": {
        "_source": ["actual", "forecast_prediction", "timestamp"],
        "size": 0,
        "query": {
          "bool": {
            "must": [{"range": {
              "timestamp": {
                "gte": "2023-01-20T00:30:00.000Z",
                "lte": "2023-01-20T20:00:00.000Z",
                "format": "strict_date_optional_time"}
            }}]
          }
        },
        "aggs": {
        "bydate": {
          "date_histogram": {
              "field": "timestamp",
              "fixed_interval": "1m",
              "min_doc_count": 1
            },
            "aggs": { 
              "elvalue": {"terms": {"field": "actual","size": 1}},
              "forecast": {"terms": {"field": "forecast_prediction","size": 1}}
            }
          }
        }
      }
    }, "format": {"property": "aggregations.bydate.buckets"}
  },
  "enconding": {
    "x": {
      "axis": {"format": "hoursminutes"},
      "field": "key",
      "title": "asdf",
      "type": "temporal"
    }
  },
  "transform": [
    {"flatten": ["elvalue.buckets"],"as": ["currentvalue"]},
    {"flatten": ["forecast.buckets"],"as": ["futurvalue"]}
  ],  
  "layer": [
    {
      "mark": {
        "interpolate": "monotone", 
        "opacity": 0.5,
        "tooltip": true,
        "type": "line"
      },
      "encoding": {
        "color": {
           "type": "point", "value": "orange"},
        "y": {
          "field": "futurvalue.key", 
          "type": "quantitative"
        },
        "x": {
          "field": "key", 
          "format": "hoursminutes",
          "title": "sfasdfasdf",
          "type": "temporal"
        },
        "tooltip": [
          {"field":"key", "type": "temporal", "format": "%d/%m/%y %H:%M", "title": "fecha"},
          {"field":"futurvalue.key", "type": "quantitative", "format": ",.2r", "title": "valor forecast"}
        ]
      }
    },
    {
      "mark": {
        "interpolate": "monotone", 
        "opacity": 1,
        "tooltip": true,
        "type": "line"
      },
      "encoding": {
        "color": {
           "type": "point", "value": "black"},
        "y": {
          "field": "currentvalue.key", 
          "type": "quantitative",
          "title": "valores"
        },
        "x": {
          "field": "key", 
          "format": "%d/%m/%y %H:%M",
          "title": "",
          "type": "temporal"
        },
        "tooltip": [
          {"field":"key", "type": "temporal", "format": "%d/%m/%y %H:%M", "title": "fecha"},
          {"field":"currentvalue.key", "type": "quantitative", "format": ",.2r", "title": "valor_actual"}
        ]
      }
    }
  ]
}

What I'm doing wrong? or isn't possible to create a graphic with forecast data on vega-lite?
Thank you very much.

Hello I would to add more information, as you can see the response of query shows data 3 hours next the current time.
why if response shows the forecast values, example on "key_as_string": "2023-01-20T16:00:00.000Z",, these data is not printed on the graphic?

{
  "took": 32,
  "timed_out": false,
  "_shards": {
    "total": 1,
    "successful": 1,
    "skipped": 0,
    "failed": 0
  },
  "hits": {
    "total": 409,
    "max_score": 1,
    "hits": [
      {
        "_index": ".ml-xxxxxxvil",
        "_id": "xxxxxxxx_forecast_kZF7wIUBHKUCZOXpiX77_1674216180000_60_0_-142261168984546803792043607818611473090_26",
        "_score": 1,
        "_source": {
          "forecast_prediction": 194.23115257143547,
          "forecast_id": "kZF7wIUBHKUCZOXpiX77",
          "timestamp": 1674216180000
        }
      },
      {
        "_index": ".xxxxxx_movil",
        "_id": "xxxxxxxxorecast_kZF7wIUBHKUCZOXpiX77_1674216240000_60_0_-142261168984546803792043607818611473090_26",
        "_score": 1,
        "_source": {
          "forecast_prediction": 194.30067612773456,
          "forecast_id": "kZF7wIUBHKUCZOXpiX77",
          "timestamp": 1674216240000
        }
      },
      {
        "_index": ".xxxxxxxxmovil",
        "_id": "rxxxxxxxxxorecast_kZF7wIUBHKUCZOXpiX77_1674216300000_60_0_-142261168984546803792043607818611473090_26",
        "_score": 1,
        "_source": {
          "forecast_prediction": 194.3705109907569,
          "forecast_id": "kZF7wIUBHKUCZOXpiX77",
          "timestamp": 1674216300000
        }
      },
      {
        "_index": ".xxxxxxml_rvia_movil",
        "_id": "rxxxxxxxforecast_kZF7wIUBHKUCZOXpiX77_1674216360000_60_0_-142261168984546803792043607818611473090_26",
        "_score": 1,
        "_source": {
          "forecast_prediction": 194.43923830329265,
          "forecast_id": "kZF7wIUBHKUCZOXpiX77",
          "timestamp": 1674216360000
        }
      }
    ]
  },
  "aggregations": {
    "bydate": {
      "buckets": [
        {
          "key_as_string": "2023-01-20T12:00:00.000Z",
          "key": 1674216000000,
          "doc_count": 31,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 20
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 1223,
                "doc_count": 2
              }
            ]
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 164.99888903776827,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 608.3046952476328,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T12:10:00.000Z",
          "key": 1674216600000,
          "doc_count": 30,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 20
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 8,
            "buckets": [
              {
                "key": 161,
                "doc_count": 1
              }
            ]
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 159.83954788767812,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 596.8168512280893,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T12:20:00.000Z",
          "key": 1674217200000,
          "doc_count": 30,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 20
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 7,
            "buckets": [
              {
                "key": 222,
                "doc_count": 2
              }
            ]
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 153.18075168672294,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 580.6921859353731,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T12:30:00.000Z",
          "key": 1674217800000,
          "doc_count": 30,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 20
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 7,
            "buckets": [
              {
                "key": 191,
                "doc_count": 2
              }
            ]
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 145.48343529131273,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 567.0365202349564,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T12:40:00.000Z",
          "key": 1674218400000,
          "doc_count": 30,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 20
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 8,
            "buckets": [
              {
                "key": 205,
                "doc_count": 2
              }
            ]
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 137.2202102610587,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 552.6512883019194,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T12:50:00.000Z",
          "key": 1674219000000,
          "doc_count": 30,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 20
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 7,
            "buckets": [
              {
                "key": 185,
                "doc_count": 2
              }
            ]
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 128.8304877247488,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 539.1988044604327,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T13:00:00.000Z",
          "key": 1674219600000,
          "doc_count": 30,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 20
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 6,
            "buckets": [
              {
                "key": 167,
                "doc_count": 3
              }
            ]
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 120.64197367192736,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 520.9446034231962,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T13:10:00.000Z",
          "key": 1674220200000,
          "doc_count": 30,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 20
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 8,
            "buckets": [
              {
                "key": 164,
                "doc_count": 2
              }
            ]
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 112.95890595390381,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 19,
            "buckets": [
              {
                "key": 507.99144403662604,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T13:20:00.000Z",
          "key": 1674220800000,
          "doc_count": 13,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 11
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 1,
            "buckets": [
              {
                "key": 146,
                "doc_count": 1
              }
            ]
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 10,
            "buckets": [
              {
                "key": 112.23011188337635,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 10,
            "buckets": [
              {
                "key": 506.7234591587502,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T13:30:00.000Z",
          "key": 1674221400000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 128.7650045336486,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 519.314593173476,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T13:40:00.000Z",
          "key": 1674222000000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 123.82139518074963,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 509.9725080929261,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T13:50:00.000Z",
          "key": 1674222600000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 119.8501076686533,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 502.3113416765282,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T14:00:00.000Z",
          "key": 1674223200000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 116.72710114890398,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 496.0677985400145,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T14:10:00.000Z",
          "key": 1674223800000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 114.57622338643061,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 487.9892786989142,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T14:20:00.000Z",
          "key": 1674224400000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 113.5289721170205,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 483.6799850660867,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T14:30:00.000Z",
          "key": 1674225000000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 113.44854252019219,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 481.0127164962853,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T14:40:00.000Z",
          "key": 1674225600000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 113.79774419133545,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 480.296730108848,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T14:50:00.000Z",
          "key": 1674226200000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 115.18188181279268,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 480.18356329421886,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T15:00:00.000Z",
          "key": 1674226800000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 117.18125657118058,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 481.2100658168749,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T15:10:00.000Z",
          "key": 1674227400000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 119.32010108137749,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 480.94800651482535,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T15:20:00.000Z",
          "key": 1674228000000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 121.12551323481631,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 481.00487322395907,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T15:30:00.000Z",
          "key": 1674228600000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 122.46981650637355,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 481.0449446205719,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T15:40:00.000Z",
          "key": 1674229200000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 123.89502309183081,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 481.1469703144203,
                "doc_count": 1
              }
            ]
          }
        },
        {
          "key_as_string": "2023-01-20T15:50:00.000Z",
          "key": 1674229800000,
          "doc_count": 10,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 10
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 126.01997790680613,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 9,
            "buckets": [
              {
                "key": 485.7819880609802,
                "doc_count": 1
              }
            ]
          }
        },
        {
          **"key_as_string": "2023-01-20T16:00:00.000Z",**
          "key": 1674230400000,
          "doc_count": 5,
          "elfuturelower": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": [
              {
                "key": 0,
                "doc_count": 5
              }
            ]
          },
          "elretardervalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 0,
            "buckets": []
          },
          "elfuturvalue": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 4,
            "buckets": [
              {
                "key": 129.4634341686073,
                "doc_count": 1
              }
            ]
          },
          "elfutureupper": {
            "doc_count_error_upper_bound": 0,
            "sum_other_doc_count": 4,
            "buckets": [
              {
                "key": 487.79840132163906,
                "doc_count": 1
              }
            ]
          }
        }
      ]
    }
  }
}

Thanks for your help

Hello, anyone could help me? Thanks

Hi @plus

welcome to the Kibana community.
in Lens when a time shift is enabled, there's a response manipulation on top of the raw ES response, what is probably why it's not that easy to reproduce in Vega lite.

But could there a way to reproduce in vega lite? Do you know someone whom could help me to deploy it? Thanks