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

From wikieduonline
Jump to navigation Jump to search
 
(21 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
  
<pre>
+
* <code>[[arithmetic_processor]]</code>
resource "datadog_logs_custom_pipeline" "sample_pipeline" {
+
* <code>[[attribute_remapper]]</code>
  filter {
+
* <code>[[category_processor]]</code>
    query = "source:foo"
+
* <code>[[date_remapper]]</code>
  }
+
* <code>[[geo_ip_parser]]</code>
  name      = "sample pipeline"
+
* <code>[[grok_parser]]</code>
  is_enabled = true
+
* <code>[[lookup_processor]]</code>
  processor {
+
* <code>[[message_remapper]]</code>
    arithmetic_processor {
+
 
      expression        = "(time1 - time2)*1000"
+
== Official example ==
      target            = "my_arithmetic"
+
resource "datadog_logs_custom_pipeline" "sample_pipeline" {
      is_replace_missing = true
+
  [[filter]] {
      name              = "sample arithmetic processor"
+
    [[query]] = "source:foo"
      is_enabled        = true
+
  }
    }
+
  name      = "sample pipeline"
  }
+
  is_enabled = true
  processor {
+
  [[processor]] {
    attribute_remapper {
+
    [[arithmetic_processor]] {
      sources              = ["db.instance"]
+
      expression        = "(time1 - time2)*1000"
      source_type          = "tag"
+
      target            = "my_arithmetic"
      target              = "db"
+
      is_replace_missing = true
      target_type          = "attribute"
+
      name              = "sample arithmetic processor"
      target_format        = "string"
+
      is_enabled        = true
      preserve_source      = true
+
    }
      override_on_conflict = false
+
  }
      name                = "sample attribute processor"
+
  processor {
      is_enabled          = true
+
    [[attribute_remapper]] {
    }
+
      sources              = ["db.instance"]
  }
+
      source_type          = "tag"
  processor {
+
      target              = "db"
    category_processor {
+
      target_type          = "attribute"
      target = "foo.severity"
+
      target_format        = "string"
      category {
+
      preserve_source      = true
        name = "debug"
+
      override_on_conflict = false
        filter {
+
      name                = "sample attribute processor"
          query = "@severity: \".\""
+
      is_enabled          = true
        }
+
    }
      }
+
  }
      category {
+
  processor {
        name = "verbose"
+
    [[category_processor]] {
        filter {
+
      target = "foo.severity"
          query = "@severity: \"-\""
+
      category {
        }
+
        name = "debug"
      }
+
        filter {
      name      = "sample category processor"
+
          query = "@severity: \".\""
      is_enabled = true
+
        }
    }
+
      }
  }
+
      category {
  processor {
+
        name = "verbose"
    date_remapper {
+
        filter {
      sources    = ["_timestamp", "published_date"]
+
          query = "@severity: \"-\""
      name      = "sample date remapper"
+
        }
 +
      }
 +
      name      = "sample category processor"
 +
      is_enabled = true
 +
    }
 +
  }
 +
  processor {
 +
    [[date_remapper]] {
 +
      sources    = ["_timestamp", "published_date"]
 +
      name      = "sample date remapper"
 
       is_enabled = true
 
       is_enabled = true
    }
+
    }
  }
+
  }
  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 65: Line 74:
 
   }
 
   }
 
   processor {
 
   processor {
     grok_parser {
+
     [[grok_parser]] {
 
       samples = ["sample log 1"]
 
       samples = ["sample log 1"]
 
       source  = "message"
 
       source  = "message"
Line 77: Line 86:
 
   }
 
   }
 
   processor {
 
   processor {
     lookup_processor {
+
     [[lookup_processor]] {
 
       source        = "service_id"
 
       source        = "service_id"
 
       target        = "service_name"
 
       target        = "service_name"
Line 87: Line 96:
 
   }
 
   }
 
   processor {
 
   processor {
     message_remapper {
+
     [[message_remapper]] {
 
       sources    = ["msg"]
 
       sources    = ["msg"]
 
       name      = "sample message remapper"
 
       name      = "sample message remapper"
Line 149: Line 158:
 
     }
 
     }
 
   }
 
   }
}
+
}
</pre>
 
  
  
 
== Related ==
 
== Related ==
[[grok_parser]]
+
* <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: