Difference between revisions of "Terraform resource: datadog logs custom pipeline"

From wikieduonline
Jump to navigation Jump to search
 
(17 intermediate revisions by the same user not shown)
Line 1: Line 1:
* https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/logs_custom_pipeline
+
<code>[[datadog_logs_custom_pipeline]]</code> https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/logs_custom_pipeline
  
 +
* <code>[[arithmetic_processor]]</code>
 +
* <code>[[attribute_remapper]]</code>
 +
* <code>[[category_processor]]</code>
 +
* <code>[[date_remapper]]</code>
 +
* <code>[[geo_ip_parser]]</code>
 +
* <code>[[grok_parser]]</code>
 +
* <code>[[lookup_processor]]</code>
 +
* <code>[[message_remapper]]</code>
 +
 +
== Official example ==
 
  resource "datadog_logs_custom_pipeline" "sample_pipeline" {
 
  resource "datadog_logs_custom_pipeline" "sample_pipeline" {
 
   [[filter]] {
 
   [[filter]] {
Line 7: Line 17:
 
   name      = "sample pipeline"
 
   name      = "sample pipeline"
 
   is_enabled = true
 
   is_enabled = true
   processor {
+
   [[processor]] {
     arithmetic_processor {
+
     [[arithmetic_processor]] {
 
       expression        = "(time1 - time2)*1000"
 
       expression        = "(time1 - time2)*1000"
 
       target            = "my_arithmetic"
 
       target            = "my_arithmetic"
Line 17: Line 27:
 
   }
 
   }
 
   processor {
 
   processor {
     attribute_remapper {
+
     [[attribute_remapper]] {
 
       sources              = ["db.instance"]
 
       sources              = ["db.instance"]
 
       source_type          = "tag"
 
       source_type          = "tag"
Line 30: Line 40:
 
   }
 
   }
 
   processor {
 
   processor {
     category_processor {
+
     [[category_processor]] {
 
       target = "foo.severity"
 
       target = "foo.severity"
 
       category {
 
       category {
Line 49: Line 59:
 
   }
 
   }
 
   processor {
 
   processor {
     date_remapper {
+
     [[date_remapper]] {
 
       sources    = ["_timestamp", "published_date"]
 
       sources    = ["_timestamp", "published_date"]
 
       name      = "sample date remapper"
 
       name      = "sample date remapper"
Line 56: Line 66:
 
   }
 
   }
 
   processor {
 
   processor {
     geo_ip_parser {
+
     [[geo_ip_parser]] {
 
       sources    = ["network.client.ip"]
 
       sources    = ["network.client.ip"]
 
       target    = "network.client.geoip"
 
       target    = "network.client.geoip"
Line 76: Line 86:
 
   }
 
   }
 
   processor {
 
   processor {
     lookup_processor {
+
     [[lookup_processor]] {
 
       source        = "service_id"
 
       source        = "service_id"
 
       target        = "service_name"
 
       target        = "service_name"
Line 86: Line 96:
 
   }
 
   }
 
   processor {
 
   processor {
     message_remapper {
+
     [[message_remapper]] {
 
       sources    = ["msg"]
 
       sources    = ["msg"]
 
       name      = "sample message remapper"
 
       name      = "sample message remapper"
Line 153: Line 163:
 
== Related ==
 
== Related ==
 
* <code>[[grok_parser]]</code>
 
* <code>[[grok_parser]]</code>
 +
* [[Datadog pipelines]]
  
 
== See also ==
 
== See also ==
 +
* {{datadog_logs_custom_pipeline}}
 
* {{tf dd}}
 
* {{tf dd}}
  
 
[[Category:TF]]
 
[[Category:TF]]

Latest revision as of 22:12, 13 October 2024

datadog_logs_custom_pipeline https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/logs_custom_pipeline

Official example[edit]

resource "datadog_logs_custom_pipeline" "sample_pipeline" {
  filter {
    query = "source:foo"
  }
  name       = "sample pipeline"
  is_enabled = true
  processor {
    arithmetic_processor {
      expression         = "(time1 - time2)*1000"
      target             = "my_arithmetic"
      is_replace_missing = true
      name               = "sample arithmetic processor"
      is_enabled         = true
    }
  }
  processor {
    attribute_remapper {
      sources              = ["db.instance"]
      source_type          = "tag"
      target               = "db"
      target_type          = "attribute"
      target_format        = "string"
      preserve_source      = true
      override_on_conflict = false
      name                 = "sample attribute processor"
      is_enabled           = true
    }
  }
  processor {
    category_processor {
      target = "foo.severity"
      category {
        name = "debug"
        filter {
          query = "@severity: \".\""
        }
      }
      category {
        name = "verbose"
        filter {
          query = "@severity: \"-\""
        }
      }
      name       = "sample category processor"
      is_enabled = true
    }
  }
  processor {
    date_remapper {
      sources    = ["_timestamp", "published_date"]
      name       = "sample date remapper"
     is_enabled = true
    }
  }
  processor {
    geo_ip_parser {
     sources    = ["network.client.ip"]
     target     = "network.client.geoip"
     name       = "sample geo ip parser"
     is_enabled = true
   }
 }
 processor {
   grok_parser {
     samples = ["sample log 1"]
     source  = "message"
     grok {
       support_rules = ""
       match_rules   = "Rule %%{word:my_word2} %%{number:my_float2}"
     }
     name       = "sample grok parser"
     is_enabled = true
   }
 }
 processor {
   lookup_processor {
     source         = "service_id"
     target         = "service_name"
     lookup_table   = ["1,my service"]
     default_lookup = "unknown service"
     name           = "sample lookup processor"
     is_enabled     = true
   }
 }
 processor {
   message_remapper {
     sources    = ["msg"]
     name       = "sample message remapper"
     is_enabled = true
   }
 }
 processor {
   pipeline {
     filter {
       query = "source:foo"
     }
     processor {
       url_parser {
         name                     = "sample url parser"
         sources                  = ["url", "extra"]
         target                   = "http_url"
         normalize_ending_slashes = true
       }
     }
     name       = "nested pipeline"
     is_enabled = true
   }
 }
 processor {
   service_remapper {
     sources    = ["service"]
     name       = "sample service remapper"
     is_enabled = true
   }
 }
 processor {
   status_remapper {
     sources    = ["info", "trace"]
     name       = "sample status remapper"
     is_enabled = true
   }
 }
 processor {
   string_builder_processor {
     target             = "user_activity"
     template           = "%%{user.name} logged in at %%{timestamp}"
     name               = "sample string builder processor"
     is_enabled         = true
     is_replace_missing = false
   }
 }
 processor {
   trace_id_remapper {
     sources    = ["dd.trace_id"]
     name       = "sample trace id remapper"
     is_enabled = true
   }
 }
 processor {
   user_agent_parser {
     sources    = ["user", "agent"]
     target     = "http_agent"
     is_encoded = false
     name       = "sample user agent parser"
     is_enabled = true
   }
 }
}


Related[edit]

See also[edit]

Advertising: