logfmt.yaml 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. pattern: logfmt
  2. inject:
  3. - key: SIMPLE_INJECTION
  4. value: "An unset variable looks like '${this}', while the value of KEY2 is '${KEY2}'"
  5. rewrite:
  6. - key: INJECTED
  7. value: "${KEY1} - ${KEY2}"
  8. inject: yes
  9. stop: no
  10. - key: INJECTED
  11. match: '^value01'
  12. value: "Key INJECTED had value '${INJECTED}' and now has this, but only on the first row of the log."
  13. - key: INJECTED
  14. not_empty: "${KEY4}"
  15. value: "KEY4 has the value '${KEY4}'; it is not empty, so INJECTED has been rewritten."
  16. - key: INJECTED
  17. match: '^KEY4 has the value'
  18. value: "This value should not appear in the logs, because the previous one matched and stopped the pipeline."
  19. - key: ANOTHER_INJECTION
  20. value: "${KEY1} - ${KEY2} - ${INJECTED} - should not work because inject is not true amd ANOTHER_INJECTION is not in the log file."
  21. - key: YET_ANOTHER_INJECTION
  22. value: "${KEY1} - ${KEY2} - ${INJECTED} - this should work because inject is yes"
  23. inject: yes
  24. - key: SIMPLE_INJECTION
  25. match: "KEY2 is 'value32'"
  26. value: "" # empty, so SIMPLE_INJECTION should not be available on row 3