datadogdatadog-dashboard

Combine date and time from two columns in Datadog


I have a CSV file imported into Datadog that contains date (DD.MM.YYYY) and timestamp (hh.mm.ss.mmm) in 2 adjacent columns as follows:

01.03.2025 12.00.35.524
01.03.2025 12.00.49.334
01.03.2025 15.58.51.402
01.03.2025 15.59.56.402
01.03.2025 16.00.12.936
01.03.2025 18.06.18.531
03.03.2025 16.49.47.989
03.03.2025 17.57.01.947
03.03.2025 17.57.16.800

Using Datadog, how do I combine these into a a single, sortable date and time format (e.g. YYYY-MM-DD hh:mm:ss)?


Solution

  • To what i understood basically, you can use a Log Pipeline Processor by navigating to your data log configuration and create one, after that you can add a Groq Parser to extract and reformat the date and time fields.

    Once you do that you can reformat the Data and Time, by using a Date Remapper processor to combine and convert the fields. Since your data has separate columns for date (DD.MM.YYYY) and time (hh.mm.ss.mmm), you need to combine them into one field and reformat it.

    Here is an example, to give an idea:

    groq {
      let date = parse_date("dd.MM.yyyy", @date_column)
      let time = parse_time("hh.mm.ss.mmm", @time_column)
      set_field("combined_datetime", format_date("yyyy-MM-dd HH:mm:ss", date + time))
    }