refs #2448 #2449 configure and run filebeat

filebeat
Natalia Serrano 2025-07-11 11:58:28 +02:00
parent 8ede4f9ee1
commit f2f373b996
3 changed files with 25 additions and 1 deletions

View File

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.24.0] - 2025-07-11
### Added
- Configure and run filebeat
## [0.23.2] - 2025-07-07
### Changed

View File

@ -5,7 +5,7 @@ set -a
source /opt/opengnsys/etc/preinit/loadenviron.sh
# Scripts de inicio.
for f in cleanesp fileslinks loadmodules metadevs mountrepo poweroff otherservices; do
for f in cleanesp fileslinks loadmodules metadevs mountrepo poweroff filebeat otherservices; do
source $OGETC/preinit/$f.sh
done
unset f

View File

@ -0,0 +1,18 @@
#!/bin/bash
F=/etc/filebeat/filebeat.yml
OGLOG_PORT=9200
if [ -f $F ]; then
PASS=$(grep "^[ ]*\(export \)\?OPTIONS=" /scripts/ogfunctions 2>&1 |sed 's/\(.*\)pass=\(\w*\)\(.*\)/\2/') ## taken from a sibling script
PASS=${PASS:-"og"}
chmod 0600 $F
sed -i -e "s/__OGLOG_IP__/$oglog/g" \
-e "s/__OGLOG_PORT__/$OGLOG_PORT/g" \
-e "s/__OPENSEARCH_PASSWORD__/$PASS/g" \
$F
unset PASS
mkdir -p /var/log/filebeat
/usr/bin/filebeat -c $F --path.home /usr/share/filebeat --path.config /etc/filebeat --path.data /var/lib/filebeat --path.logs /var/log/filebeat &
fi