Sha256: 422224bbf7e9ba51adb0ce1af6eadf2834b02843bae078c752702167d6b8830d

Contents?: true

Size: 1.03 KB

Versions: 19

Compression:

Stored size: 1.03 KB

Contents

# Aggregate compute events with group by returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::LogsAPI.new

body = DatadogAPIClient::V2::LogsAggregateRequest.new({
  compute: [
    DatadogAPIClient::V2::LogsCompute.new({
      aggregation: DatadogAPIClient::V2::LogsAggregationFunction::COUNT,
      interval: "5m",
      type: DatadogAPIClient::V2::LogsComputeType::TIMESERIES,
    }),
  ],
  filter: DatadogAPIClient::V2::LogsQueryFilter.new({
    from: "now-15m",
    indexes: [
      "main",
    ],
    query: "*",
    to: "now",
  }),
  group_by: [
    DatadogAPIClient::V2::LogsGroupBy.new({
      facet: "host",
      missing: "miss",
      sort: DatadogAPIClient::V2::LogsAggregateSort.new({
        type: DatadogAPIClient::V2::LogsAggregateSortType::MEASURE,
        order: DatadogAPIClient::V2::LogsSortOrder::ASCENDING,
        aggregation: DatadogAPIClient::V2::LogsAggregationFunction::PERCENTILE_90,
        metric: "@duration",
      }),
      total: true,
    }),
  ],
})
p api_instance.aggregate_logs(body)

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
datadog_api_client-2.13.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.12.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.11.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.10.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.9.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.8.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.7.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.6.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.5.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.4.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.3.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.2.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.1.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.0.2 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.0.1 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-2.0.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-1.11.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-1.10.0 examples/v2/logs/AggregateLogs_2955613758.rb
datadog_api_client-1.9.0 examples/v2/logs/AggregateLogs_2955613758.rb