{"id":1979,"date":"2021-09-07T08:34:41","date_gmt":"2021-09-07T06:34:41","guid":{"rendered":"http:\/\/clark.tipistrani.it\/?p=1979"},"modified":"2021-09-15T12:59:25","modified_gmt":"2021-09-15T10:59:25","slug":"filebeat-yml-per-server","status":"publish","type":"post","link":"http:\/\/clark.tipistrani.it\/?p=1979","title":{"rendered":"filebeat.yml per server"},"content":{"rendered":"<p>N.B.<br \/>\ncopiare i files .yml in .orig per avere un backup dato che sbagliare con lo yml \u00e8 troppo facile e con uno spazio in pi\u00f9 o in meno c&#8217;\u00e8 da impazzire.<\/p>\n<p>apt-get install elastichsearch<br \/>\nvisto che il mondo \u00e8 ormai systemd l&#8217;installazione non crea i link di runlevel, quindi update-rc.d filebeat defaults<\/p>\n<p>cd \/etc\/filebeat<\/p>\n<p>cp filebeat.yml filebeat.orig<\/p>\n<p>vim filebeat.yml<br \/>\nil file \u00e8 lunghissimo e quindi riporto solo le parti modificate, il resto \u00e8 come da setup<\/p>\n<p># ================================== Outputs ===================================<\/p>\n<p># Configure what output to use when sending the data collected by the beat.<\/p>\n<p># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- Elasticsearch Output &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\n#output.elasticsearch:<br \/>\n# Array of hosts to connect to.<br \/>\n# hosts: [&#8220;localhost:9200&#8221;]<\/p>\n<p># Protocol &#8211; either `http` (default) or `https`.<br \/>\n#protocol: &#8220;https&#8221;<\/p>\n<p># Authentication credentials &#8211; either API key or username\/password.<br \/>\n#api_key: &#8220;id:api_key&#8221;<br \/>\n#username: &#8220;elastic&#8221;<br \/>\n#password: &#8220;changeme&#8221;<\/p>\n<p># &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; Logstash Output &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br \/>\noutput.logstash:<br \/>\n# The Logstash hosts<br \/>\nhosts: [&#8220;IP_di_ardito:5044&#8221;]<\/p>\n<p>una veloce verifica prima di avviare il demone<br \/>\n[root@ardito filebeat]# filebeat test config<br \/>\nConfig OK<br \/>\n[root@ardito filebeat]# filebeat test output<br \/>\nlogstash: IP_di_ardito:5044&#8230;<br \/>\nconnection&#8230;<br \/>\nparse host&#8230; OK<br \/>\ndns lookup&#8230; OK<br \/>\naddresses: IP_di_ardito<br \/>\ndial up&#8230; OK<br \/>\nTLS&#8230; WARN secure connection disabled<br \/>\ntalk to server&#8230; OK<br \/>\nbisogna ridirigere l&#8217;output con il comando:<\/p>\n<p>filebeat setup \\<br \/>\n&#8211;index-management -E output.logstash.enabled=false \\<br \/>\n-E &#8216;output.elasticsearch.hosts=[&#8220;IP_di_ardito:9200&#8221;]&#8217;<br \/>\nOverwriting ILM policy is disabled. Set `setup.ilm.overwrite: true` for enabling.<\/p>\n<p>Index setup finished.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>N.B. copiare i files .yml in .orig per avere un backup dato che sbagliare con lo yml \u00e8 troppo facile e con uno spazio in pi\u00f9 o in meno c&#8217;\u00e8 da impazzire. apt-get install elastichsearch visto che il mondo \u00e8 ormai systemd l&#8217;installazione non crea i link di runlevel, quindi update-rc.d filebeat defaults cd \/etc\/filebeat [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,14,6],"tags":[213,219,216],"class_list":["post-1979","post","type-post","status-publish","format-standard","hentry","category-linux","category-networking","category-work","tag-elk","tag-filebeat-yml","tag-yaml"],"_links":{"self":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts\/1979","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1979"}],"version-history":[{"count":4,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts\/1979\/revisions"}],"predecessor-version":[{"id":2006,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=\/wp\/v2\/posts\/1979\/revisions\/2006"}],"wp:attachment":[{"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1979"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1979"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/clark.tipistrani.it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1979"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}