Configure LogStash on docker

Scenario:

Configure LogStash on docker.

Solution:

  • Access and login to core os, in command line
  • ls
  • cd elasticsearch
  • cd logstashpipeline
  • vim api.confg (longstash configuration file)
input {
  redis {
    codec => "json"
    data_type => "list"
    host => "redis"
    key => "api"
    port => "6379"
    tags => ["local"]
    add_field => {"origin" => "myapp-api-local"}
  }
}

output {
  if " myapp-api-local " in [origin] {
    elasticsearch {
      action => "index"
      hosts => ["http://elasticsearch:9200"]
      index => "logstash-myapp-api-%{+YYYY.MM.dd}"
    }
  }
}
~
  • :wq 
  • cd ..
  • cat stop.sh
  • ./stop.sh
  • ./start.sh
  • git status
  • git add *
  • git status
  • git commit -a -m "Comments"
  • git push
In Vim

Hit the Esc key to enter Normal mode and type : for Command line mode.
·        :q - quit
·        :q! - quit
·        :wq - write and quit
·        qa – quit instance
·        i – insert mode
·        dd to delete line
·        dw to delete single word
·        Delete key to delete characters

No comments:

Post a Comment

Move Github Sub Repository back to main repo

 -- delete .gitmodules git rm --cached MyProject/Core git commit -m 'Remove myproject_core submodule' rm -rf MyProject/Core git remo...