Sha256: dd38e9f8df7fbea360d6fb926669af93a9d099a7cd9528f6d129af98355f74f1

Contents?: true

Size: 1.11 KB

Versions: 8

Compression:

Stored size: 1.11 KB

Contents

# Create a Splunk custom destination returns "OK" response

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

body = DatadogAPIClient::V2::CustomDestinationCreateRequest.new({
  data: DatadogAPIClient::V2::CustomDestinationCreateRequestDefinition.new({
    attributes: DatadogAPIClient::V2::CustomDestinationCreateRequestAttributes.new({
      enabled: false,
      forward_tags: false,
      forward_tags_restriction_list: [
        "datacenter",
        "host",
      ],
      forward_tags_restriction_list_type: DatadogAPIClient::V2::CustomDestinationAttributeTagsRestrictionListType::ALLOW_LIST,
      forwarder_destination: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunk.new({
        access_token: "my-access-token",
        endpoint: "https://example.com",
        type: DatadogAPIClient::V2::CustomDestinationForwardDestinationSplunkType::SPLUNK_HEC,
      }),
      name: "Nginx logs",
      query: "source:nginx",
    }),
    type: DatadogAPIClient::V2::CustomDestinationType::CUSTOM_DESTINATION,
  }),
})
p api_instance.create_logs_custom_destination(body)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1288180912.rb
datadog_api_client-2.27.1 examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1288180912.rb
datadog_api_client-2.26.1 examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1288180912.rb
datadog_api_client-2.26.0 examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1288180912.rb
datadog_api_client-2.25.0 examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1288180912.rb
datadog_api_client-2.24.0 examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1288180912.rb
datadog_api_client-2.22.0 examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1288180912.rb
datadog_api_client-2.21.0 examples/v2/logs-custom-destinations/CreateLogsCustomDestination_1288180912.rb