"use strict";
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.LogsCustomPipeline = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("./utilities"));
/**
 * Provides a Datadog [Logs Pipeline API](https://docs.datadoghq.com/api/v1/logs-pipelines/) resource, which is used to create and manage Datadog logs custom pipelines. Each `datadog.LogsCustomPipeline` resource defines a complete pipeline. The order of the pipelines is maintained in a different resource: `datadog.LogsPipelineOrder`. When creating a new pipeline, you need to **explicitly** add this pipeline to the `datadog.LogsPipelineOrder` resource to track the pipeline. Similarly, when a pipeline needs to be destroyed, remove its references from the `datadog.LogsPipelineOrder` resource.
 *
 * ## Example Usage
 *
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as datadog from "@pulumi/datadog";
 *
 * const samplePipeline = new datadog.LogsCustomPipeline("sample_pipeline", {
 *     filters: [{
 *         query: "source:foo",
 *     }],
 *     name: "sample pipeline",
 *     isEnabled: true,
 *     processors: [
 *         {
 *             arithmeticProcessor: {
 *                 expression: "(time1 - time2)*1000",
 *                 target: "my_arithmetic",
 *                 isReplaceMissing: true,
 *                 name: "sample arithmetic processor",
 *                 isEnabled: true,
 *             },
 *         },
 *         {
 *             attributeRemapper: {
 *                 sources: ["db.instance"],
 *                 sourceType: "tag",
 *                 target: "db",
 *                 targetType: "attribute",
 *                 targetFormat: "string",
 *                 preserveSource: true,
 *                 overrideOnConflict: false,
 *                 name: "sample attribute processor",
 *                 isEnabled: true,
 *             },
 *         },
 *         {
 *             categoryProcessor: {
 *                 target: "foo.severity",
 *                 categories: [
 *                     {
 *                         name: "debug",
 *                         filter: {
 *                             query: "@severity: \".\"",
 *                         },
 *                     },
 *                     {
 *                         name: "verbose",
 *                         filter: {
 *                             query: "@severity: \"-\"",
 *                         },
 *                     },
 *                 ],
 *                 name: "sample category processor",
 *                 isEnabled: true,
 *             },
 *         },
 *         {
 *             dateRemapper: {
 *                 sources: [
 *                     "_timestamp",
 *                     "published_date",
 *                 ],
 *                 name: "sample date remapper",
 *                 isEnabled: true,
 *             },
 *         },
 *         {
 *             geoIpParser: {
 *                 sources: ["network.client.ip"],
 *                 target: "network.client.geoip",
 *                 name: "sample geo ip parser",
 *                 isEnabled: true,
 *             },
 *         },
 *         {
 *             grokParser: {
 *                 samples: ["sample log 1"],
 *                 source: "message",
 *                 grok: {
 *                     supportRules: "",
 *                     matchRules: "Rule %{word:my_word2} %{number:my_float2}",
 *                 },
 *                 name: "sample grok parser",
 *                 isEnabled: true,
 *             },
 *         },
 *         {
 *             lookupProcessor: {
 *                 source: "service_id",
 *                 target: "service_name",
 *                 lookupTables: ["1,my service"],
 *                 defaultLookup: "unknown service",
 *                 name: "sample lookup processor",
 *                 isEnabled: true,
 *             },
 *         },
 *         {
 *             messageRemapper: {
 *                 sources: ["msg"],
 *                 name: "sample message remapper",
 *                 isEnabled: true,
 *             },
 *         },
 *         {
 *             pipeline: {
 *                 filters: [{
 *                     query: "source:foo",
 *                 }],
 *                 processors: [{
 *                     urlParser: {
 *                         name: "sample url parser",
 *                         sources: [
 *                             "url",
 *                             "extra",
 *                         ],
 *                         target: "http_url",
 *                         normalizeEndingSlashes: true,
 *                     },
 *                 }],
 *                 name: "nested pipeline",
 *                 isEnabled: true,
 *             },
 *         },
 *         {
 *             serviceRemapper: {
 *                 sources: ["service"],
 *                 name: "sample service remapper",
 *                 isEnabled: true,
 *             },
 *         },
 *         {
 *             statusRemapper: {
 *                 sources: [
 *                     "info",
 *                     "trace",
 *                 ],
 *                 name: "sample status remapper",
 *                 isEnabled: true,
 *             },
 *         },
 *         {
 *             stringBuilderProcessor: {
 *                 target: "user_activity",
 *                 template: "%{user.name} logged in at %{timestamp}",
 *                 name: "sample string builder processor",
 *                 isEnabled: true,
 *                 isReplaceMissing: false,
 *             },
 *         },
 *         {
 *             traceIdRemapper: {
 *                 sources: ["dd.trace_id"],
 *                 name: "sample trace id remapper",
 *                 isEnabled: true,
 *             },
 *         },
 *         {
 *             userAgentParser: {
 *                 sources: [
 *                     "user",
 *                     "agent",
 *                 ],
 *                 target: "http_agent",
 *                 isEncoded: false,
 *                 name: "sample user agent parser",
 *                 isEnabled: true,
 *             },
 *         },
 *     ],
 * });
 * ```
 *
 * ## Import
 *
 * The `pulumi import` command can be used, for example:
 *
 * To find the pipeline ID, click the "edit" button in the UI to open the pipeline details.
 * The pipeline ID is the last part of the URL.
 *
 * ```sh
 * $ pulumi import datadog:index/logsCustomPipeline:LogsCustomPipeline name> <pipelineID>
 * ```
 */
class LogsCustomPipeline extends pulumi.CustomResource {
    /**
     * Get an existing LogsCustomPipeline resource's state with the given name, ID, and optional extra
     * properties used to qualify the lookup.
     *
     * @param name The _unique_ name of the resulting resource.
     * @param id The _unique_ provider ID of the resource to lookup.
     * @param state Any extra arguments used during the lookup.
     * @param opts Optional settings to control the behavior of the CustomResource.
     */
    static get(name, id, state, opts) {
        return new LogsCustomPipeline(name, state, { ...opts, id: id });
    }
    /** @internal */
    static __pulumiType = 'datadog:index/logsCustomPipeline:LogsCustomPipeline';
    /**
     * Returns true if the given object is an instance of LogsCustomPipeline.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj) {
        if (obj === undefined || obj === null) {
            return false;
        }
        return obj['__pulumiType'] === LogsCustomPipeline.__pulumiType;
    }
    constructor(name, argsOrState, opts) {
        let resourceInputs = {};
        opts = opts || {};
        if (opts.id) {
            const state = argsOrState;
            resourceInputs["description"] = state?.description;
            resourceInputs["filters"] = state?.filters;
            resourceInputs["isEnabled"] = state?.isEnabled;
            resourceInputs["name"] = state?.name;
            resourceInputs["processors"] = state?.processors;
            resourceInputs["tags"] = state?.tags;
        }
        else {
            const args = argsOrState;
            if (args?.filters === undefined && !opts.urn) {
                throw new Error("Missing required property 'filters'");
            }
            if (args?.name === undefined && !opts.urn) {
                throw new Error("Missing required property 'name'");
            }
            resourceInputs["description"] = args?.description;
            resourceInputs["filters"] = args?.filters;
            resourceInputs["isEnabled"] = args?.isEnabled;
            resourceInputs["name"] = args?.name;
            resourceInputs["processors"] = args?.processors;
            resourceInputs["tags"] = args?.tags;
        }
        opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
        super(LogsCustomPipeline.__pulumiType, name, resourceInputs, opts);
    }
}
exports.LogsCustomPipeline = LogsCustomPipeline;
//# sourceMappingURL=logsCustomPipeline.js.map