Add Environment Variables Processor

This page is not yet available in Spanish. We are working on its translation.
If you have any questions or feedback about our current translation project, feel free to reach out to us!

Utiliza este procesador para añadir un nombre de campo y el valor de una variable de entorno al mensaje de log.

Para configurar este procesador:

  1. Define una consulta de filtro. Sólo se procesan los logs que coinciden con la consulta de filtro especificada. Todos los logs, independientemente de si coinciden con la consulta de filtro, se envían al siguiente paso del pipeline.
  2. Introduce el nombre del campo para la variable de entorno.
  3. Introduce el nombre de la variable de entorno.
  4. Haz clic en Add Environment Variable (Añadir variable de entorno) si deseas añadir otra variable de entorno.
Variables de entorno bloqueadas

Las variables de entorno que coincidan con alguno de los siguientes patrones no podrán añadirse a los mensajes de log porque la variable de entorno podría contener datos confidenciales.

  • CONNECTIONSTRING / CONNECTION-STRING / CONNECTION_STRING
  • AUTH
  • CERT
  • CLIENTID / CLIENT-ID / CLIENT_ID
  • CREDENTIALS
  • DATABASEURL / DATABASE-URL / DATABASE_URL
  • DBURL / DB-URL / DB_URL
  • KEY
  • OAUTH
  • PASSWORD
  • PWD
  • ROOT
  • SECRET
  • TOKEN
  • USER

La variable de entorno coincide con el patrón y no con la palabra literal. Por ejemplo, PASSWORD bloquea las variables de entorno como USER_PASSWORD y PASSWORD_SECRET para que no se añadan a los mensajes de log.

Filter query syntax

Each processor has a corresponding filter query in their fields. Processors only process logs that match their filter query. And for all processors except the filter processor, logs that do not match the query are sent to the next step of the pipeline. For the filter processor, logs that do not match the query are dropped.

For any attribute, tag, or key:value pair that is not a reserved attribute, your query must start with @. Conversely, to filter reserved attributes, you do not need to append @ in front of your filter query.

For example, to filter out and drop status:info logs, your filter can be set as NOT (status:info). To filter out and drop system-status:info, your filter must be set as NOT (@system-status:info).

Filter query examples:

  • NOT (status:debug): This filters for only logs that do not have the status DEBUG.
  • status:ok service:flask-web-app: This filters for all logs with the status OK from your flask-web-app service.
    • This query can also be written as: status:ok AND service:flask-web-app.
  • host:COMP-A9JNGYK OR host:COMP-J58KAS: This filter query only matches logs from the labeled hosts.
  • @user.status:inactive: This filters for logs with the status inactive nested under the user attribute.

Queries run in the Observability Pipelines Worker are case sensitive. Learn more about writing filter queries in Datadog’s Log Search Syntax.