Advertisement
Guest User

My example Logstash pipeline

a guest
Nov 17th, 2021
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. input { pipeline { address => my_main_pipeline } }
  2. filter {
  3. mutate {
  4. copy => { "[log][file][path]" => "log_file_path" }
  5. }
  6. }
  7. output {
  8. elasticsearch {
  9. index => "i-my_index-%{[fields][project]}-%{[fields][instance]}-%{[fields][tenant]}-%{[fields][context]}-%{[fields][subcontext]}-%{+yyyy.MM.dd}"
  10. cloud_id => "${MY_ELASTIC_CLOUD_ID}"
  11. cloud_auth => "${MY_ELASTIC_CLOUD_AUTH}"
  12. }
  13. if [fields][subcontext] == "my_metrics" {
  14. file {
  15. path => "<PATH TO USE. DESIRABLY, I'D USE [log][file][path] HERE, BUT THE PATH ISSUE IS MAKING IT IMPOSSIBLE FOR ME>"
  16. codec => line { format => "{\"Timestamp\": \"%{Timestamp}\", \"Timezone\": \"%{Timezone}\", \"Body\": %{Body} "}
  17. }
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement