Class DatadogLogsFilter

java.lang.Object
codes.grow.packages.datadoglogs.DatadogLogsFilter
Direct Known Subclasses:
AggregateLogsOptions, SearchLogsRequest

public abstract class DatadogLogsFilter extends Object
Filter shared by search and aggregate: query (default *), time window (default now-15m to now), indexes (default ["*"]) and storage tier (default indexes).

Times are strings as the API takes them: ISO-8601, epoch milliseconds or date math such as now-15m; Instant values are sent as ISO-8601 UTC with milliseconds.

  • Field Details

  • Constructor Details

    • DatadogLogsFilter

      protected DatadogLogsFilter(DatadogLogsFilter.Builder<?> b)
      Copies the filter fields of a builder.
      Parameters:
      b - builder
  • Method Details

    • formatTime

      public static String formatTime(Instant t)
      Formats an instant for from / to: ISO-8601 UTC with milliseconds.
      Parameters:
      t - the instant
      Returns:
      for example 2026-11-18T12:00:00.000Z
    • query

      public String query()
      Returns the Datadog search query.
      Returns:
      the query (* when none was set)
    • from

      public String from()
      Returns the window start.
      Returns:
      the time string
    • to

      public String to()
      Returns the window end.
      Returns:
      the time string
    • indexes

      public List<String> indexes()
      Returns the indexes to search.
      Returns:
      immutable list
    • storageTier

      public StorageTier storageTier()
      Returns the storage tier.
      Returns:
      the tier
    • filterBody

      public Map<String,Object> filterBody()
      Returns the wire form (filter object).
      Returns:
      a new map