rpm -ivh /root/packetbeat-7.0.0-x86_64.rpm
14 packetbeat.interfaces.device: any # packetbeat devices (se pueden usar nombres o posición) 131 setup.dashboards.enabled: true 149 host: "192.168.93.128:5601" 223 xpack.monitoring.enabled: true 230 xpack.monitoring.elasticsearch:
packetbeat devices packetbeat test config -c packetbeat.yml systemctl start packetbeat.service systemctl status packetbeat.service
input {
stdin {}
}
output {
stdout {
codec => json_lines
}
}
→ convierte la entrada de teclado en cadenas JSON (y más info)
cp /elk/example.conf /etc/logstash/ /usr/share/logstash/bin/logstash -f /etc/logstash/example.conf
input {
stdin {
codec => multiline {
pattern => "^fin"
negate => "true"
what => "next"
}
}
}
output {
stdout {
codec => json_lines
}
}
cp /elk/example-codec-multiline.conf /etc/logstash/ /usr/share/logstash/bin/logstash -f /etc/logstash/example-codec-multiline.conf
input {
file {
path => "/logs/access_log"
exclude => "*.gz"
start_position => "beginning"
sincedb_path => "/logs/access.sincedb"
}
}
output {
stdout {
codec => json_lines
}
}
/usr/share/logstash/bin/logstash -f /etc/logstash/example-codec-file.conf
input {
file {
path => "/logs/log-generator*.log"
exclude => "*.gz"
start_position => "beginning"
sincedb_path => "/logs/log-generator.sincedb"
codec => multiline {
pattern => "^(DEBUG|INFO|ERROR|TRACE|FATAL|WARN).*"
negate => "true"
what => "previous"
}
}
}
output {
stdout {
# codec => json_lines
}
}
/usr/share/logstash/bin/logstash -f /etc/logstash/example-codec-file-2.conf
rpm -ivh /root/filebeat-6.7.1-x86_64.rpm
29 - /logs/log-generator.log 149 #output.elasticsearch: 150 # Array of hosts to connect to. 151 #hosts: ["localhost:9200"] 162 output.logstash: 163 # The Logstash hosts 164 hosts: ["localhost:5044"]
input {
beats {
port => 5044
}
}
output {
stdout {}
}
systemctl start filebeat.service /usr/share/logstash/bin/logstash -f /etc/logstash/example-beat.conf