Advertisement
Guest User

Untitled

a guest
Mar 12th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.17 KB | None | 0 0
  1. ## service
  2. cp /etc/init.d/filebeat /etc/init.d/filebeat2
  3.  
  4. ```
  5. ** patch **
  6. diff -u /etc/init.d/filebeat /etc/init.d/filebeat2 #patch
  7.  
  8. --- /etc/init.d/filebeat 2018-10-31 06:25:05.000000000 +0800
  9. +++ /etc/init.d/filebeat2 2019-03-08 14:24:37.945218496 +0800
  10. @@ -23,9 +23,9 @@
  11. export PATH
  12.  
  13. [ -f /etc/sysconfig/filebeat ] && . /etc/sysconfig/filebeat
  14. -pidfile=${PIDFILE-/var/run/filebeat.pid}
  15. +pidfile=${PIDFILE-/var/run/filebeat2.pid}
  16. agent=${BEATS_AGENT-/usr/share/filebeat/bin/filebeat}
  17. -args="-c /etc/filebeat/filebeat.yml -path.home /usr/share/filebeat -path.config /etc/filebeat -path.data /var/lib/filebeat -path.logs /var/log/filebeat"
  18. +args="-c /etc/filebeat2/filebeat.yml -path.home /usr/share/filebeat -path.config /etc/filebeat2 -path.data /var/lib/filebeat2 -path.logs /var/log/filebeat2"
  19. test_args="-e test config"
  20. beat_user="${BEAT_USER:-root}"
  21. wrapper="/usr/share/filebeat/bin/filebeat-god"
  22. ```
  23.  
  24. ## /etc/filebeat2
  25. cp -Rf /etc/filebeat /etc/filebeat2
  26. cp modules.d/apache2.yml.disabled modules.d/apache2.yml
  27.  
  28. ## filebeat.yml
  29. ```
  30. filebeat.config.modules.path: /etc/filebeat2/modules.d/*.yml
  31. output:
  32. elasticsearch:
  33. hosts: ["xx.xx.xx.xx:xx1"]
  34. username: "pixara"
  35. password: "pixara403"
  36. setup.kibana:
  37. host: "xx.xx.xx.xx:xx2"
  38. username: "pixara"
  39. password: "pixara403"
  40. ```
  41.  
  42. ## apache2.yml
  43. ```
  44. diff -u apache2.yml.disabled apache2.yml
  45. --- apache2.yml.disabled 2019-03-08 13:43:44.653165809 +0800
  46. +++ apache2.yml 2019-03-08 14:41:12.666207062 +0800
  47. @@ -6,6 +6,7 @@
  48. # Set custom paths for the log files. If left empty,
  49. # Filebeat will choose the paths depending on your OS.
  50. #var.paths:
  51. + var.paths: ["/www/apachelog/*_access_log"]
  52.  
  53. # Error logs
  54. error:
  55. @@ -14,3 +15,4 @@
  56. # Set custom paths for the log files. If left empty,
  57. # Filebeat will choose the paths depending on your OS.
  58. #var.paths:
  59. + var.paths: ["/www/apachelog/*_error_log"]
  60.  
  61. ```
  62.  
  63. ## setup
  64.  
  65. ```
  66. filebeat -path.config /etc/filebeat2 -c /etc/filebeat2/filebeat.yml setup
  67. ```
  68.  
  69.  
  70.  
  71. # elastic
  72.  
  73. ```
  74. /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-geoip
  75. /usr/share/elasticsearch/bin/elasticsearch-plugin install ingest-user-agent
  76. ```
  77. ```
  78. service elasticsearch restart
  79. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement