Commit 61a2e825 authored by Paul Graydon's avatar Paul Graydon

software/ors-amarisoft: Add fluentbit tag and tail state tracking

parent 86d54d98
......@@ -88,7 +88,7 @@ md5sum = 52da9fe3a569199e35ad89ae1a44c30e
[template-enb]
_update_hash_filename_ = instance-enb.jinja2.cfg
md5sum = 8b9301f26fc4ffbc7eda9c1ac8da1a46
md5sum = 140cce72eb04768abbe87ea4982f36bd
[template-ors-enb]
_update_hash_filename_ = instance-ors-enb.jinja2.cfg
......
......@@ -80,6 +80,7 @@ script = ${:etc}/run
service = ${:etc}/service
promise = ${:etc}/promise
log = ${:var}/log
xlog-fluentbit = ${:var}/xlog-fluentbit
{% if slapparameter_dict.get("enb_config_link", None) %}
[enb-config-dl]
......@@ -149,6 +150,26 @@ command-line = ${xamari-xlog-script:output}
hash-files = ${:command-line}
{% if slapparameter_dict.get('xlog_fluentbit_forward_host') %}
[xlog-fluentbit-tag]
recipe = slapos.recipe.build
computer = ${slap-connection:computer-id}
enb-id = {{ slapparameter_dict.get("enb_id", "") }}
gnb-id = {{ slapparameter_dict.get("gnb_id", "") }}
init =
import socket
options['hostname'] = socket.gethostname()
radio_id = ''
if options['enb-id']:
radio_id = 'e%s' % options['enb-id']
elif options['gnb-id']:
radio_id = 'g%s' % options['gnb-id']
options['radio-id'] = radio_id
xlog_fluentbit_tag = '_'.join(options[x] for x in ('hostname', 'computer', 'radio-id') if options[x])
options['xlog-fluentbit-tag'] = xlog_fluentbit_tag
[xlog-fluentbit-config]
recipe = slapos.recipe.template
output = ${directory:etc}/${:_buildout_section_name_}.cfg
......@@ -163,7 +184,9 @@ inline =
[INPUT]
name tail
path ${:logfile}
tag ${xlog-fluentbit-tag:xlog-fluentbit-tag}
Read_from_Head True
db ${directory:xlog-fluentbit}/tail-state
[OUTPUT]
name forward
match *
......@@ -240,6 +263,9 @@ ru-list = {{ dumps(rulib.iru_dict.keys() | sort) }}
cell-list = {{ dumps(rulib.icell_dict.keys() | sort) }}
peer-list = {{ dumps(ipeer_dict.keys() | sort) }}
peer-cell-list = {{ dumps(ipeercell_dict.keys() | sort) }}
{%- if slapparameter_dict.get('xlog_fluentbit_forward_host') %}
fluentbit-tag = ${xlog-fluentbit-tag:xlog-fluentbit-tag}
{%- endif %}
[monitor-instance-parameter]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment