<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://178.140.10.58:8080/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://178.140.10.58:8080/feed.php">
        <title>Библиотека знаний - software:fluent-bit-loki-grafana:fluent-bit</title>
        <description>Заметки IT программиста</description>
        <link>http://178.140.10.58:8080/</link>
        <image rdf:resource="http://178.140.10.58:8080/lib/exe/fetch.php?media=wiki:dokuwiki.svg" />
       <dc:date>2026-04-17T13:41:04+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:docker-swarm-1"/>
                <rdf:li rdf:resource="http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:docker-swarm-2"/>
                <rdf:li rdf:resource="http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:docker-swarm-syslog-ng-1"/>
                <rdf:li rdf:resource="http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:docker-swarm-syslog-ng"/>
                <rdf:li rdf:resource="http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:example"/>
                <rdf:li rdf:resource="http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:start"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://178.140.10.58:8080/lib/exe/fetch.php?media=wiki:dokuwiki.svg">
        <title>Библиотека знаний</title>
        <link>http://178.140.10.58:8080/</link>
        <url>http://178.140.10.58:8080/lib/exe/fetch.php?media=wiki:dokuwiki.svg</url>
    </image>
    <item rdf:about="http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:docker-swarm-1">
        <dc:format>text/html</dc:format>
        <dc:date>2025-11-26T00:26:35+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Обработка многострочных логов</title>
        <link>http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:docker-swarm-1</link>
        <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;обработка_многострочных_логов&quot;&gt;Обработка многострочных логов&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0445 \u043b\u043e\u0433\u043e\u0432&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430_\u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0445_\u043b\u043e\u0433\u043e\u0432&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-72&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit2&quot; id=&quot;fluent-bitconf&quot;&gt;fluent-bit.conf&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code ini&quot;&gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;SERVICE&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Daemon Off
    Flush &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    Log_Level info
    Parsers_File /fluent-bit/etc/parsers.conf
    HTTP_Server On
    HTTP_Listen 0.0.0.0
    HTTP_Port &lt;span class=&quot;nu0&quot;&gt;2020&lt;/span&gt;
&amp;nbsp;
# Вход для Docker JSON логов
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;INPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name tail
    Path /var/lib/docker/containers/*/*.log
    Tag docker.*
    Parser docker
    Docker_Mode On
    Docker_Mode_Flush &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;
    Mem_Buf_Limit 50MB
    Skip_Long_Lines On
    Refresh_Interval &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
    DB /var/log/flb-storage/tail.db
    DB.sync normal
&amp;nbsp;
# Парсинг JSON логов GitLab
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name parser
    Match docker.*
    Key_Name log
    Parser json_auto
    Reserve_Data On
    Preserve_Key On
&amp;nbsp;
# Добавление Docker метаданных
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name modify
    Match docker.*
    Rename docker.container_id container_id
    Rename docker.container_name container_name
    Add log_source docker
    Add node_id $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;NODE_ID&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    Add node_name $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;NODE_NAME&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    Add cluster docker_swarm
&amp;nbsp;
# Обработка многострочных логов &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;стектрейсы GitLab&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name multiline
    Match docker.*
    multiline.key_content log
    multiline.parser java, go, python, ruby
&amp;nbsp;
# Выход в Loki
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;OUTPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name grafana-loki
    Match *
    Url http://loki:&lt;span class=&quot;nu0&quot;&gt;3100&lt;/span&gt;/loki/api/v1/push
    TenantID &lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;
    Labels &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;job&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;fluent-bit&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    LabelKeys container_name,node_name,log_source
    RemoveKeys docker_id,container_id
    BatchWait &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    BatchSize 1MB
    LineFormat json
    DropSingleKey Off&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;fluent-bit.conf&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;fluent-bitconf&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;73-1584&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit3&quot; id=&quot;parsers_multilineconf&quot;&gt;parsers_multiline.conf&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code ini&quot;&gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name docker
    Format json
    Time_Key time
    Time_Format %Y-%m-%dT%H:%M:%S.%LZ
    Time_Keep On
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name json_auto
    Format json
    Time_Key time
    Time_Format %Y-%m-%dT%H:%M:%S.%LZ
    Time_Keep On
&amp;nbsp;
# Парсер для многострочных логов GitLab
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name gitlab_multiline_firstline
    Format regex
    Regex ^\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;T\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;\.\d+Z|^&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;\&lt;span class=&quot;st0&quot;&gt;&amp;quot;time\&amp;quot;&lt;/span&gt;:\&lt;span class=&quot;st0&quot;&gt;&amp;quot;\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z
&amp;nbsp;
[MULTILINE_PARSER]
    Name gitlab_multiline
    Type regex
    Flush_Timeout 1000
    Rule &amp;quot;&lt;/span&gt;start_state&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;^\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;T\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;\.\d+Z|^&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;\&lt;span class=&quot;st0&quot;&gt;&amp;quot;time\&amp;quot;&lt;/span&gt;:\&lt;span class=&quot;st0&quot;&gt;&amp;quot;\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z&amp;quot;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;cont&amp;quot;&lt;/span&gt;
    Rule &lt;span class=&quot;st0&quot;&gt;&amp;quot;cont&amp;quot;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;^(?!\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z|^{\&amp;quot;&lt;/span&gt;time\&lt;span class=&quot;st0&quot;&gt;&amp;quot;:\&amp;quot;&lt;/span&gt;\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;T\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;\.\d+Z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.*&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;cont&lt;span class=&quot;st0&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;parsers_multiline.conf&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;parsers_multilineconf&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1585-2449&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit4&quot; id=&quot;docker_metadata&quot;&gt;docker_metadata&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code lua&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;function&lt;/span&gt; docker_metadata&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;tag&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; timestamp&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; record&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;local&lt;/span&gt; docker &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#039;docker_metadata&#039;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;co1&quot;&gt;-- Получаем container_id из пути файла&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;local&lt;/span&gt; container_id &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; record&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;docker.container_id&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; container_id &lt;span class=&quot;kw1&quot;&gt;then&lt;/span&gt;
        &lt;span class=&quot;co1&quot;&gt;-- Добавляем дополнительные метаданные&lt;/span&gt;
        record&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;container_id_short&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;string.sub&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;container_id&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;12&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
        record&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;log_type&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;docker_json&amp;quot;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;end&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; timestamp&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; record
&lt;span class=&quot;kw1&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;docker_metadata&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;docker_metadata&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;2450-2984&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit5&quot; id=&quot;установка&quot;&gt;Установка&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Создаем конфиги&lt;/span&gt;
$ docker config create loki_config .&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;loki-config.yaml
$ docker config create fluent_bit_config .&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit.conf
$ docker config create fluent_bit_parser .&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;parsers.conf
$ docker config create docker_metadata .&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;docker-metadata.lua&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;2985-3295&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit6&quot; id=&quot;loki_config&quot;&gt;loki_config&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code yaml&quot;&gt;&lt;span class=&quot;co3&quot;&gt;auth_enabled&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;false
&lt;span class=&quot;co4&quot;&gt;
server&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  http_listen_port&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;3100&lt;span class=&quot;co3&quot;&gt;
  grpc_listen_port&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;9096
&lt;span class=&quot;co4&quot;&gt;
common&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  path&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;/loki&lt;span class=&quot;co4&quot;&gt;
  storage&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
    filesystem&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
      chunks_directory&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;/loki/chunks&lt;span class=&quot;co3&quot;&gt;
      rules_directory&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;/loki/rules&lt;span class=&quot;co3&quot;&gt;
  replication_factor&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1&lt;span class=&quot;co4&quot;&gt;
  ring&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
    instance_addr&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;127.0.0.1&lt;span class=&quot;co4&quot;&gt;
    kvstore&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
      store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;inmemory
&lt;span class=&quot;co4&quot;&gt;
query_range&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
  results_cache&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
    cache&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
      embedded_cache&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
        enabled&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;true&lt;span class=&quot;co3&quot;&gt;
        max_size_mb&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;100
&lt;span class=&quot;co4&quot;&gt;
schema_config&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
  configs&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
    - from&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;2020-10-24&lt;span class=&quot;co3&quot;&gt;
      store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;boltdb-shipper&lt;span class=&quot;co3&quot;&gt;
      object_store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;filesystem&lt;span class=&quot;co3&quot;&gt;
      schema&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;v11&lt;span class=&quot;co4&quot;&gt;
      index&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
        prefix&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;index_&lt;span class=&quot;co3&quot;&gt;
        period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;24h
&lt;span class=&quot;co4&quot;&gt;
ruler&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  alertmanager_url&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;http://localhost:9093
&lt;span class=&quot;co4&quot;&gt;
analytics&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  reporting_enabled&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;false&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;loki_config&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;loki_config&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;3296-4017&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit7&quot; id=&quot;развертывание&quot;&gt;Развертывание&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Запускаем стек&lt;/span&gt;
$ docker stack deploy &lt;span class=&quot;re5&quot;&gt;-c&lt;/span&gt; docker-compose.yml logging&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:5,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;4018-4156&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit8&quot; id=&quot;проверка_работы&quot;&gt;Проверка работы&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Проверяем сервисы&lt;/span&gt;
docker service &lt;span class=&quot;kw2&quot;&gt;ls&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Смотрим логи Fluent Bit&lt;/span&gt;
docker service logs logging_fluent-bit
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Проверяем Loki&lt;/span&gt;
curl http:&lt;span class=&quot;sy0&quot;&gt;//&lt;/span&gt;localhost:&lt;span class=&quot;nu0&quot;&gt;3100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;ready
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Проверяем метрики Fluent Bit&lt;/span&gt;
curl http:&lt;span class=&quot;sy0&quot;&gt;//&lt;/span&gt;localhost:&lt;span class=&quot;nu0&quot;&gt;2020&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;api&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;v1&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;metrics&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430_\u0440\u0430\u0431\u043e\u0442\u044b&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:6,&amp;quot;secid&amp;quot;:8,&amp;quot;range&amp;quot;:&amp;quot;4157-4497&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit9&quot; id=&quot;запросы_в_grafana&quot;&gt;Запросы в Grafana&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code&quot;&gt;{job=&amp;quot;fluent-bit&amp;quot;} |= &amp;quot;gitlab&amp;quot;&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;{container_name=&amp;quot;gitlab&amp;quot;} &lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;{job=&amp;quot;fluent-bit&amp;quot;} |~ &amp;quot;(?i)error|exception|fail&amp;quot;&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;{node_name=&amp;quot;node-1&amp;quot;}&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# Все логи GitLab
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} &lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# Логи по компонентам
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | component=&amp;quot;gitaly.UnaryServerInterceptor&amp;quot;&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# Ошибки
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | level=&amp;quot;error&amp;quot;&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# Запросы с определенным correlation_id
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | correlation_id=&amp;quot;01KAJ30DCE4BW6JSAT7KHGZ9PX&amp;quot;&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# Логи Sidekiq
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | severity=&amp;quot;INFO&amp;quot;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0432 Grafana&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0437\u0430\u043f\u0440\u043e\u0441\u044b_\u0432_grafana&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:7,&amp;quot;secid&amp;quot;:9,&amp;quot;range&amp;quot;:&amp;quot;4498-&amp;quot;} --&gt;</description>
    </item>
    <item rdf:about="http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:docker-swarm-2">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-06T03:35:25+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Обработка логов Docker</title>
        <link>http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:docker-swarm-2</link>
        <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;обработка_логов_docker&quot;&gt;Обработка логов Docker&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043b\u043e\u0433\u043e\u0432 Docker&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430_\u043b\u043e\u0433\u043e\u0432_docker&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-52&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit2&quot; id=&quot;fluent-bitconf&quot;&gt;fluent-bit.conf&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code ini&quot;&gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;SERVICE&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    flush                     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    log_level                 info
    daemon                    off
    storage.path              /var/log/flb-storage/
    storage.sync              normal
    storage.checksum          off
    storage.max_chunks_up     &lt;span class=&quot;nu0&quot;&gt;128&lt;/span&gt;
    storage.backlog.mem_limit 10M
    parsers_file              parsers.conf
    http_server               on
    http_listen               0.0.0.0
    http_port                 &lt;span class=&quot;nu0&quot;&gt;2020&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;INPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name              tail
    Path              /var/lib/docker/containers/*/*.log
    Parser            docker
    Refresh_Interval  &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
    Ignore_Older      1h
    Docker_Mode       On
    Tag               docker.&amp;lt;file_name&amp;gt;
    Tag_Regex         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;file_name&amp;gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;a-f0-9&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;-json.log
    Mem_Buf_Limit     50MB
    Skip_Long_Lines   On
    DB                /var/log/flb-storage/flb_db.db
    DB.sync           normal
    Storage.Type      filesystem
    Read_from_Head    false
&amp;nbsp;
# Только для отладки
# &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;INPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
#     Name              tail
#     Path              /var/lib/docker/containers/*/*.log
#     Parser            docker
#     Refresh_Interval  &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
#     Docker_Mode       On
#     Tag               docker.&amp;lt;file_name&amp;gt;
#     Tag_Regex         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;file_name&amp;gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;a-f0-9&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;-json.log
#     Mem_Buf_Limit     50MB
#     Skip_Long_Lines   On
#     DB                /var/log/flb-storage/flb_db.db
#     DB.sync           normal
#     Storage.Type      filesystem
#     Read_from_Head    true
&amp;nbsp;
# Фильтруем пустые логи
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                grep
    match               docker.*
    Exclude             log ^$
    Exclude             log ^\s*$
    Exclude             log ^&lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt;&amp;gt;.+&amp;lt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;=$&lt;/span&gt;
&amp;nbsp;
# Извлекаем сырой лог
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                modify
    match               docker.*
    copy                log raw_log
    copy                exception.backtrace exception_backtrace
    copy                exception.class exception_class
    copy                exception.message exception_message
&amp;nbsp;
# Очищаем docker.* - оставляем ТОЛЬКО нужные поля
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                record_modifier
    match               docker.*
&amp;nbsp;
    whitelist_key       date
    whitelist_key       log
    whitelist_key       raw_log
    whitelist_key       exception_backtrace
    whitelist_key       exception_class
    whitelist_key       exception_message
&amp;nbsp;
    whitelist_key       method
    whitelist_key       path
    whitelist_key       action
    whitelist_key       status
    whitelist_key       remote_ip
    whitelist_key       controller
    whitelist_key       line_id
&amp;nbsp;
#
# FILTERS
#
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              nginx_access
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              gitlab_json
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              gitlab_registry
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              sidekiq_json
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              mysql_error
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              mysql_slow
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              postgresql
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              postgresql_detailed
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              nextcloud_access
    reserve_data        true
    Preserve_Key        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              apache_access
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              php_fpm
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              grafana_regex
    reserve_data        true
&amp;nbsp;
# Структуризация распарсенных полей В raw_log
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                nest
    match               docker.*
    operation           nest
    wildcard            remote_*
    wildcard            method
    wildcard            path
    wildcard            status
    wildcard            body_bytes
    wildcard            user_agent
    wildcard            referrer
    wildcard            logger
    wildcard            endpoint
    wildcard            pluginId
    wildcard            dsName
    wildcard            dsUID
    wildcard            uname
    wildcard            level
    wildcard            msg
    wildcard            statusCode
    wildcard            resourcePath
    wildcard            exception
    nest_under          parsed_data
&amp;nbsp;
#
# FILTERS
#
&amp;nbsp;
# Метаданные Docker
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                lua
    match               docker.*
    script              /fluent-bit/bin/docker-metadata.lua
    call                enrich_with_docker_metadata
&amp;nbsp;
# Копируем метаданные
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                modify
    match               docker.*
    copy                docker.hostname hostname
    copy                docker.container_started started
    copy                docker.container_name container_name
    copy                docker.container_name service_name
    copy                docker.container_id container_id
    copy                docker.state state
    copy                docker.stream stream
    copy                docker.line_id line_id
&amp;nbsp;
    copy                log _raw
    copy                parsed_data _parsed
    # copy                exception_class _class
    # copy                exception_message _message
    # copy                exception_backtrace _backtrace
&amp;nbsp;
    copy                docker.label_project project
    copy                docker.label_service service
    copy                docker.label_logging logging
    copy                docker.label_logging_jobname logging_jobname
&amp;nbsp;
# Структурируем через nest
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                nest
    match               docker.*
    operation           nest
    wildcard            _*
    nest_under          log
    remove_prefix       _
&amp;nbsp;
# Добавляем host metadata
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                modify
    match               docker.*
    set                 node_id $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;NODE_ID&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    set                 node_name $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;NODE_NAME&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    set                 host_name $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;NODE_NAME&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
# Перетагиваем только логи с enabled logging
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                rewrite_tag
    match               docker.*
    rule                $logging ^enabled$ data.$container_id true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                record_modifier
    match               data.*
&amp;nbsp;
    whitelist_key       date
    whitelist_key       log
    whitelist_key       exception_class
    whitelist_key       exception_message
    whitelist_key       exception_backtrace
&amp;nbsp;
    whitelist_key       method
    whitelist_key       path
    whitelist_key       action
    whitelist_key       status
    whitelist_key       remote_ip
    whitelist_key       controller
    whitelist_key       line_id
&amp;nbsp;
    whitelist_key       node_id
    whitelist_key       node_name
    whitelist_key       host_name
    whitelist_key       hostname
    whitelist_key       started
    whitelist_key       container_name
    whitelist_key       service_name
    whitelist_key       container_id
    whitelist_key       stream
    whitelist_key       project
    whitelist_key       service
    whitelist_key       logging_jobname
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;OUTPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                loki
    match               data.*
    host                loki
    port                &lt;span class=&quot;nu0&quot;&gt;3100&lt;/span&gt;
    labels              job&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;$logging_jobname, node_name=$node_name, container_id=$container_id, container_name=$container_name, service_name=$service_name, project=$project, service=$service, level=$stream&lt;/span&gt;
    label_keys          $node_name,$container_id,$container_name,$service_name,$project,$service
    line_format         json
    auto_kubernetes_labels off
&amp;nbsp;
# Только для отладки
# &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;OUTPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
#     name                stdout
#     match               data.*
#     format              json&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;fluent-bit.conf&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;fluent-bitconf&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;53-9076&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit3&quot; id=&quot;parsersconf&quot;&gt;parsers.conf&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code ini&quot;&gt;# Базовый парсер для Docker JSON логов
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        docker
    Format      json
    Time_Key    time
    Time_Format %Y-%m-%dT%H:%M:%S.%LZ
    Time_Keep   On
&amp;nbsp;
# Nginx access логи
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        nginx_access
    Format      regex
    Regex       ^&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;remote_ip&amp;gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; - - \&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;timestamp&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;(?&amp;lt;method&amp;gt;\w+) (?&amp;lt;path&amp;gt;[^ ]*) HTTP/[0-9.]+&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;status&amp;gt;\d+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;body_bytes&amp;gt;\d+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;(?&amp;lt;referrer&amp;gt;[^&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;user_agent&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^&lt;span class=&quot;st0&quot;&gt;&amp;quot;]*)&amp;quot;&lt;/span&gt;
    Time_Key    timestamp
    Time_Format %d/%b/%Y:%H:%M:%S %z
&amp;nbsp;
# Gitlab JSON логи &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;application logs&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        gitlab_json
    Format      json
    # Time_Key    time    # Используем время из Docker
    Time_Keep   On
&amp;nbsp;
# GitLab Registry логи
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        gitlab_registry
    Format      regex
    Regex       ^\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;_\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;\.\d+ time&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;(?&amp;lt;time&amp;gt;[^&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot; level=(?&amp;lt;level&amp;gt;\w+) msg=&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;msg&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^&lt;span class=&quot;st0&quot;&gt;&amp;quot;]*)&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;rest&amp;gt;.*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    Time_Key    time
    Time_Format %Y-%m-%dT%H:%M:%S.%LZ
    Time_Keep   On
&amp;nbsp;
# Sidekiq JSON логи
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        sidekiq_json
    Format      json
    # Time_Key    time    # Используем время из Docker
    Time_Keep   On
&amp;nbsp;
# Nextcloud Apache-style логи
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        nextcloud_access
    Format      regex
    Regex       ^&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;remote_ip&amp;gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;user_ident&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;user_id&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; \&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;timestamp&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;(?&amp;lt;method&amp;gt;\w+) (?&amp;lt;path&amp;gt;[^ ]*) HTTP/[0-9.]+&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;status&amp;gt;\d+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;body_bytes&amp;gt;\d+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;(?&amp;lt;referrer&amp;gt;[^&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;user_agent&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^&lt;span class=&quot;st0&quot;&gt;&amp;quot;]*)&amp;quot;&lt;/span&gt;
    Time_Key    timestamp
    Time_Format %d/%b/%Y:%H:%M:%S %z  # ← Apache/Nginx формат!
    Time_Keep   On
&amp;nbsp;
# Apache access логи
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        apache_access
    Format      regex
    Regex       ^&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;remote_ip&amp;gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; - - \&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;timestamp&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;(?&amp;lt;method&amp;gt;\w+) (?&amp;lt;path&amp;gt;[^ ]*) HTTP/[0-9.]+&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;status&amp;gt;\d+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;body_bytes&amp;gt;\d+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;(?&amp;lt;referrer&amp;gt;[^&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;user_agent&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^&lt;span class=&quot;st0&quot;&gt;&amp;quot;]*)&amp;quot;&lt;/span&gt;
    Time_Key    timestamp
    Time_Format %d/%b/%Y:%H:%M:%S %z
&amp;nbsp;
# MySQL error логи
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        mysql_error
    Format      regex
    Regex       ^&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;timestamp&amp;gt;\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;T\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;.\d+Z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;level&amp;gt;\w+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;message&amp;gt;.*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    Time_Key    timestamp
    Time_Format %Y-%m-%dT%H:%M:%S.%LZ
    Time_Keep   On
&amp;nbsp;
# MySQL slow query логи
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        mysql_slow
    Format      regex
    Regex       ^# Time: &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;timestamp&amp;gt;\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;T\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;.\d+Z&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.*# User@Host: &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;user&amp;gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^\&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;database&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; @ &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;host&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;\w\.&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;\s*\&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;ip&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;\d\.&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;.*# Query_time: &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;query_time&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;\d\.&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; Lock_time: &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;lock_time&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;\d\.&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; Rows_sent: &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;rows_sent&amp;gt;\d*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; Rows_examined: &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;rows_examined&amp;gt;\d*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.*use &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;used_database&amp;gt;\w*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;.*SET timestamp&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;timestamp_unix&amp;gt;\d*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;query&amp;gt;.*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/span&gt;
    Time_Key    timestamp
    Time_Format %Y-%m-%dT%H:%M:%S.%LZ
    Time_Keep   On
&amp;nbsp;
# PostgreSQL логи
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        postgresql
    Format      regex
    Regex       ^&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;timestamp&amp;gt;\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; \d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;.\d+ &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;A-Z&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;3&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; \&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;pid&amp;gt;\d+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;level&amp;gt;\w+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:\s*&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;message&amp;gt;.*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    Time_Key    timestamp
    Time_Format %Y-%m-%d %H:%M:%S.%L %Z
    Time_Keep   On
&amp;nbsp;
# PostgreSQL extended логи &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;с деталями запросов&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        postgresql_detailed
    Format      regex
    Regex       ^&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;timestamp&amp;gt;\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;-\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt; \d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;:\d&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;.\d+ &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;A-Z&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;3&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; \&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;pid&amp;gt;\d+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;level&amp;gt;\w+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;:\s*duration: &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;duration&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;\d\.&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; ms\s*&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;message&amp;gt;.*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    Time_Key    timestamp
    Time_Format %Y-%m-%d %H:%M:%S.%L %Z
    Time_Keep   On
&amp;nbsp;
# PHP-FPM логи
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        php_fpm
    Format      regex
    Regex       ^\&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;timestamp&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;level&amp;gt;\w+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;: &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;message&amp;gt;.*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
    Time_Key    timestamp
    Time_Format %d-%b-%Y %H:%M:%S
    Time_Keep   On
&amp;nbsp;
# Стандартный syslog
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        syslog_rfc3164
    Format      regex
    Regex       ^\&amp;lt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;pri&amp;gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;0-9&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;\&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;timestamp&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;* &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;1,2&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;* &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;host&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;ident&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;a-zA-Z0-9_\/\.\-&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?:\&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;pid&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;0-9&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;+&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;\&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;?&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?:&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^\:&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;*\:&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;? &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;message&amp;gt;.*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;$
    Time_Key    timestamp
    Time_Format %b %d %H:%M:%S
    Time_Keep   On
&amp;nbsp;
# Grafana лог формата key&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;value&lt;/span&gt;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        grafana_logfmt
    Format      logfmt
    Time_Key    t
    Time_Format %Y-%m-%dT%H:%M:%S.%LZ
    Time_Keep   On
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;PARSER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name        grafana_regex
    Format      regex
    Regex       logger&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;logger&amp;gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; endpoint&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;endpoint&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; pluginId&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;pluginId&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; dsName&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;dsName&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; dsUID&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;dsUID&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; uname&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;uname&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; t&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;t&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; level&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;level&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^ &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; msg=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;(?&amp;lt;msg&amp;gt;[^&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot; error=(?&amp;lt;error&amp;gt;[^ ]*) statusCode=(?&amp;lt;statusCode&amp;gt;[^ ]*) resourcePath=&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;resourcePath&amp;gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;^&lt;span class=&quot;st0&quot;&gt;&amp;quot;]*)&amp;quot;&lt;/span&gt;
    Time_Key    t
    Time_Format %Y-%m-%dT%H:%M:%S.%LZ
    Time_Keep   On&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;parsers.conf&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;parsersconf&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;9077-13794&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit4&quot; id=&quot;установка&quot;&gt;Установка&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&amp;nbsp;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;13795-13844&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit5&quot; id=&quot;loki_config&quot;&gt;loki_config&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code yaml&quot;&gt;&lt;span class=&quot;co3&quot;&gt;auth_enabled&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;false
&lt;span class=&quot;co4&quot;&gt;
server&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  http_listen_port&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;3100
&lt;span class=&quot;co4&quot;&gt;
common&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  instance_addr&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;127.0.0.1&lt;span class=&quot;co3&quot;&gt;
  path_prefix&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;/loki&lt;span class=&quot;co4&quot;&gt;
  storage&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
    filesystem&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
      chunks_directory&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;/loki/chunks&lt;span class=&quot;co3&quot;&gt;
      rules_directory&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;/loki/rules&lt;span class=&quot;co3&quot;&gt;
  replication_factor&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1&lt;span class=&quot;co4&quot;&gt;
  ring&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
    kvstore&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
      store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;inmemory
&lt;span class=&quot;co4&quot;&gt;
schema_config&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
  configs&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
    - from&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;2020-10-24&lt;span class=&quot;co3&quot;&gt;
      store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;tsdb&lt;span class=&quot;co3&quot;&gt;
      object_store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;filesystem&lt;span class=&quot;co3&quot;&gt;
      schema&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;v13&lt;span class=&quot;co4&quot;&gt;
      index&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
        prefix&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;index_&lt;span class=&quot;co3&quot;&gt;
        period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;24h
&lt;span class=&quot;co4&quot;&gt;
ruler&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  alertmanager_url&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;http://localhost:9093
&lt;span class=&quot;co4&quot;&gt;
limits_config&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  retention_period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;720h&lt;span class=&quot;co3&quot;&gt;
  reject_old_samples&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;true&lt;span class=&quot;co3&quot;&gt;
  reject_old_samples_max_age&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;720h&lt;span class=&quot;co3&quot;&gt;
  allow_structured_metadata&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;true&lt;span class=&quot;co3&quot;&gt;
  max_query_length&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;721h
  &lt;span class=&quot;co4&quot;&gt;
ingester&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
  lifecycler&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
    ring&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
      kvstore&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
        store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;inmemory&lt;span class=&quot;co3&quot;&gt;
      replication_factor&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1&lt;span class=&quot;co3&quot;&gt;
    final_sleep&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;0s&lt;span class=&quot;co3&quot;&gt;
  chunk_idle_period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1h&lt;span class=&quot;co3&quot;&gt;
  max_chunk_age&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1h&lt;span class=&quot;co3&quot;&gt;
  chunk_target_size&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1048576&lt;span class=&quot;co3&quot;&gt;
  chunk_retain_period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;30s
&lt;span class=&quot;co4&quot;&gt;
table_manager&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  retention_deletes_enabled&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;true&lt;span class=&quot;co3&quot;&gt;
  retention_period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;720h&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;loki_config&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;loki_config&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;13845-14847&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit6&quot; id=&quot;развертывание&quot;&gt;Развертывание&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&amp;nbsp;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;14848-14905&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit7&quot; id=&quot;проверка_работы&quot;&gt;Проверка работы&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Проверяем конфигурацию&lt;/span&gt;
$ docker &lt;span class=&quot;kw3&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-it&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;fluentbit_container&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;bin&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit &lt;span class=&quot;re5&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit.conf &lt;span class=&quot;re5&quot;&gt;--dry-run&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Смотрим логи&lt;/span&gt;
$ docker service logs logging_fluent-bit
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Проверяем метрики&lt;/span&gt;
$ curl http:&lt;span class=&quot;sy0&quot;&gt;//&lt;/span&gt;localhost:&lt;span class=&quot;nu0&quot;&gt;2020&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;api&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;v1&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;metrics &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; jq
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Тестируем парсеры&lt;/span&gt;
$ &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;2025-11-21T02:13:34.366Z {&amp;quot;method&amp;quot;:&amp;quot;PUT&amp;quot;,&amp;quot;path&amp;quot;:&amp;quot;/projects&amp;quot;,&amp;quot;status&amp;quot;:500}&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; \
$ docker &lt;span class=&quot;kw3&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;fluentbit_container&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;bin&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit &lt;span class=&quot;re5&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit.conf &lt;span class=&quot;re5&quot;&gt;-i&lt;/span&gt; stdin &lt;span class=&quot;re5&quot;&gt;-o&lt;/span&gt; stdout&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430_\u0440\u0430\u0431\u043e\u0442\u044b&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:5,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;14906-15521&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit8&quot; id=&quot;запросы_в_grafana&quot;&gt;Запросы в Grafana&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code json&quot;&gt;{job=&amp;quot;fluent-bit&amp;quot;} |= &amp;quot;gitlab&amp;quot;
&amp;nbsp;
{container_name=&amp;quot;gitlab&amp;quot;} 
&amp;nbsp;
{job=&amp;quot;fluent-bit&amp;quot;} |~ &amp;quot;(?i)error|exception|fail&amp;quot;
&amp;nbsp;
{node_name=&amp;quot;node-1&amp;quot;}
&amp;nbsp;
# Все логи GitLab
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} 
&amp;nbsp;
# Логи по компонентам
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | component=&amp;quot;gitaly.UnaryServerInterceptor&amp;quot;
&amp;nbsp;
# Ошибки
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | level=&amp;quot;error&amp;quot;
&amp;nbsp;
# Запросы с определенным correlation_id
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | correlation_id=&amp;quot;01KAJ30DCE4BW6JSAT7KHGZ9PX&amp;quot;
&amp;nbsp;
# Логи Sidekiq
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | severity=&amp;quot;INFO&amp;quot;
&amp;nbsp;
# Все логи GitLab с parsed_data
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json
&amp;nbsp;
# Логи с ошибками
{environment=&amp;quot;production&amp;quot;} | json | level=&amp;quot;error&amp;quot; 
&amp;nbsp;
# Медленные PostgreSQL запросы
{service_name=~&amp;quot;.*postgres.*&amp;quot;} | json | duration &amp;gt; 1000
&amp;nbsp;
# Nginx 5xx ошибки
{container_name=~&amp;quot;.*nginx.*&amp;quot;} | json | status &amp;gt;= 500
&amp;nbsp;
# Sidekiq логи
{container_name=~&amp;quot;.*sidekiq.*&amp;quot;} | json | severity=&amp;quot;INFO&amp;quot;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0432 Grafana&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0437\u0430\u043f\u0440\u043e\u0441\u044b_\u0432_grafana&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:6,&amp;quot;secid&amp;quot;:8,&amp;quot;range&amp;quot;:&amp;quot;15522-&amp;quot;} --&gt;</description>
    </item>
    <item rdf:about="http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:docker-swarm-syslog-ng-1">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-07T02:11:51+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Обработка логов syslog + Docker</title>
        <link>http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:docker-swarm-syslog-ng-1</link>
        <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;обработка_логов_syslog_docker&quot;&gt;Обработка логов syslog + Docker&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043b\u043e\u0433\u043e\u0432 syslog + Docker&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430_\u043b\u043e\u0433\u043e\u0432_syslog_docker&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-61&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit2&quot; id=&quot;fluent-bitconf&quot;&gt;fluent-bit.conf&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code ini&quot;&gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;SERVICE&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    flush                     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    log_level                 info
    daemon                    off
    storage.path              /var/log/flb-storage/
    storage.sync              normal
    storage.checksum          off
    storage.max_chunks_up     &lt;span class=&quot;nu0&quot;&gt;128&lt;/span&gt;
    storage.backlog.mem_limit 10M
    parsers_file              parsers.conf
    http_server               on
    http_listen               0.0.0.0
    http_port                 &lt;span class=&quot;nu0&quot;&gt;2020&lt;/span&gt;
    coro_stack_size           &lt;span class=&quot;nu0&quot;&gt;24576&lt;/span&gt;
    plugins_path              /fluent-bit/bin/
&amp;nbsp;
# &lt;span class=&quot;sy0&quot;&gt;====================&lt;/span&gt; ASUS ROUTER SYSLOG INPUT &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;===================&lt;/span&gt;
# &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;INPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
#     name              syslog
#     listen            0.0.0.0
#     port              &lt;span class=&quot;nu0&quot;&gt;5140&lt;/span&gt;
#     parser            syslog-rfc5424
#     tag               router.syslog
#     buffer_chunk_size 4MB
#     buffer_max_size   16MB
#     mode              tcp
&amp;nbsp;
# &lt;span class=&quot;sy0&quot;&gt;====================&lt;/span&gt; DOCKER LOGS INPUT &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;===================&lt;/span&gt;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;INPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name              tail
    path              /var/lib/docker/containers/*/*.log
    parser            docker
    refresh_interval  &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;
    ignore_older      1h
    docker_mode       on
    tag               docker.&amp;lt;file_name&amp;gt;
    tag_regex         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;file_name&amp;gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;a-f0-9&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;-json.log
    mem_buf_limit     50MB
    skip_long_lines   on
    db                /var/log/flb-storage/flb_db.db
    db.sync           normal
    storage.type      filesystem
    read_from_head    false
&amp;nbsp;
# Только для отладки
# &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;INPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
#     Name              tail
#     Path              /var/lib/docker/containers/*/*.log
#     Parser            docker
#     Refresh_Interval  &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
#     Docker_Mode       On
#     Tag               docker.&amp;lt;file_name&amp;gt;
#     Tag_Regex         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;file_name&amp;gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;a-f0-9&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;-json.log
#     Mem_Buf_Limit     50MB
#     Skip_Long_Lines   On
#     DB                /var/log/flb-storage/flb_db.db
#     DB.sync           normal
#     Storage.Type      filesystem
#     Read_from_Head    true
&amp;nbsp;
# &lt;span class=&quot;sy0&quot;&gt;====================&lt;/span&gt; DOCKER FILTERS &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;===================&lt;/span&gt;
&amp;nbsp;
# Фильтруем пустые логи
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                grep
    match               docker.*
    exclude             log ^$
    exclude             log ^\s*$
    exclude             log ^&lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt;&amp;gt;.+&amp;lt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;=$&lt;/span&gt;
&amp;nbsp;
# Извлекаем сырой лог
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                modify
    match               docker.*
    copy                log raw_log
    copy                exception.backtrace exception_backtrace
    copy                exception.class exception_class
    copy                exception.message exception_message
&amp;nbsp;
# Очищаем docker.* - оставляем ТОЛЬКО нужные поля
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                record_modifier
    match               docker.*
&amp;nbsp;
    whitelist_key       date
    whitelist_key       log
    whitelist_key       raw_log
    whitelist_key       exception_backtrace
    whitelist_key       exception_class
    whitelist_key       exception_message
&amp;nbsp;
    whitelist_key       method
    whitelist_key       path
    whitelist_key       action
    whitelist_key       status
    whitelist_key       remote_ip
    whitelist_key       controller
    whitelist_key       line_id
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              nginx_access
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              gitlab_json
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              gitlab_registry
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              sidekiq_json
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              mysql_error
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              mysql_slow
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              postgresql
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              postgresql_detailed
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              nextcloud_access
    reserve_data        true
    preserve_key        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              apache_access
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              php_fpm
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              grafana_regex
    reserve_data        true
&amp;nbsp;
# Структуризация распарсенных полей В raw_log
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                nest
    match               docker.*
    operation           nest
    wildcard            remote_*
    wildcard            method
    wildcard            path
    wildcard            status
    wildcard            body_bytes
    wildcard            user_agent
    wildcard            referrer
    wildcard            logger
    wildcard            endpoint
    wildcard            pluginId
    wildcard            dsName
    wildcard            dsUID
    wildcard            uname
    wildcard            level
    wildcard            msg
    wildcard            statusCode
    wildcard            resourcePath
    wildcard            exception
    nest_under          parsed_data
&amp;nbsp;
# Метаданные Docker
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                lua
    match               docker.*
    script              /fluent-bit/bin/docker-metadata.lua
    call                enrich_with_docker_metadata
&amp;nbsp;
# Копируем метаданные
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                modify
    match               docker.*
    copy                docker.hostname hostname
    copy                docker.container_started started
    copy                docker.container_name container_name
    copy                docker.container_name service_name
    copy                docker.container_id container_id
    copy                docker.state state
    copy                docker.stream stream
    copy                docker.line_id line_id
&amp;nbsp;
    copy                log _raw
    copy                parsed_data _parsed
    # copy                exception_class _class
    # copy                exception_message _message
    # copy                exception_backtrace _backtrace
&amp;nbsp;
    copy                docker.label_project project
    copy                docker.label_service service
    copy                docker.label_logging logging
    copy                docker.label_logging_jobname logging_jobname
&amp;nbsp;
# Структурируем через nest
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                nest
    match               docker.*
    operation           nest
    wildcard            _*
    nest_under          log
    remove_prefix       _
&amp;nbsp;
# Добавляем host metadata
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                modify
    match               docker.*
    set                 node_id $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;NODE_ID&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    set                 node_name $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;NODE_NAME&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    set                 host_name $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;NODE_NAME&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
# Перетагиваем только логи с enabled logging
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                rewrite_tag
    match               docker.*
    rule                $logging ^enabled$ data.$container_id true
&amp;nbsp;
# &lt;span class=&quot;sy0&quot;&gt;====================&lt;/span&gt; ROUTER FILTERS &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;===================&lt;/span&gt;
&amp;nbsp;
# &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
#     name                parser
#     match               router.*
#     key_name            message
#     parser              router_logs
#     reserve_data        true
&amp;nbsp;
# &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
#     name                record_modifier
#     match               router.*
#     record              hostname $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;HOSTNAME&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
#     record              device_type router
#     record              source asus_merlin
#     record              cluster docker_swarm
&amp;nbsp;
# &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
#     name                modify
#     match               router.*
#     rename              host source_host
#     rename              ident facility
#     set                 log_type syslog
#     set                 environment production
&amp;nbsp;
# &lt;span class=&quot;sy0&quot;&gt;====================&lt;/span&gt; DOCKER FILTERS &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;===================&lt;/span&gt;
&amp;nbsp;
# Отфильтровываем служебные контейнеры
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                grep
    match               docker.*
    exclude             container_name ^/loki.*
    exclude             container_name ^/fluent-bit.*
    exclude             container_name ^/grafana.*
    exclude             container_name ^/traefik.*
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                record_modifier
    match               data.*
&amp;nbsp;
    whitelist_key       date
    whitelist_key       log
    whitelist_key       exception_class
    whitelist_key       exception_message
    whitelist_key       exception_backtrace
&amp;nbsp;
    whitelist_key       method
    whitelist_key       path
    whitelist_key       action
    whitelist_key       status
    whitelist_key       remote_ip
    whitelist_key       controller
    whitelist_key       line_id
&amp;nbsp;
    whitelist_key       node_id
    whitelist_key       node_name
    whitelist_key       host_name
    whitelist_key       hostname
    whitelist_key       started
    whitelist_key       container_name
    whitelist_key       service_name
    whitelist_key       container_id
    whitelist_key       stream
    whitelist_key       project
    whitelist_key       service
    whitelist_key       logging_jobname
&amp;nbsp;
# &lt;span class=&quot;sy0&quot;&gt;====================&lt;/span&gt; OUTPUTS &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;===================&lt;/span&gt;
&amp;nbsp;
# Логи docker в Loki
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;OUTPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                loki
    match               data.*
    host                loki
    port                &lt;span class=&quot;nu0&quot;&gt;3100&lt;/span&gt;
    labels              job&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;$logging_jobname, node_name=$node_name, container_id=$container_id, container_name=$container_name, service_name=$service_name, project=$project, service=$service, level=$stream&lt;/span&gt;
    line_format         json
    auto_kubernetes_labels off
&amp;nbsp;
# Логи роутера в Loki
# &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;OUTPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
#     name                loki
#     match               router.*
#     host                loki
#     port                &lt;span class=&quot;nu0&quot;&gt;3100&lt;/span&gt;
#     labels              job&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;asus_router, device_type=router, source=syslog, cluster=docker_swarm&lt;/span&gt;
#     line_format         key_value
#     auto_kubernetes_labels off
&amp;nbsp;
&amp;nbsp;
# Только для отладки
# &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;OUTPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
#     name                stdout
#     match               data.*
#     format              json&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;fluent-bit.conf&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;fluent-bitconf&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;62-11098&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit3&quot; id=&quot;parsersconf&quot;&gt;parsers.conf&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code ini&quot;&gt;&amp;nbsp;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;parsers.conf&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;parsersconf&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;11099-11142&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit4&quot; id=&quot;loki_config&quot;&gt;loki_config&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code yaml&quot;&gt;&lt;span class=&quot;co3&quot;&gt;auth_enabled&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;false
&lt;span class=&quot;co4&quot;&gt;
server&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  http_listen_port&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;3100
&lt;span class=&quot;co4&quot;&gt;
common&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  instance_addr&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;127.0.0.1&lt;span class=&quot;co3&quot;&gt;
  path_prefix&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;/loki&lt;span class=&quot;co4&quot;&gt;
  storage&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
    filesystem&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
      chunks_directory&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;/loki/chunks&lt;span class=&quot;co3&quot;&gt;
      rules_directory&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;/loki/rules&lt;span class=&quot;co3&quot;&gt;
  replication_factor&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1&lt;span class=&quot;co4&quot;&gt;
  ring&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
    kvstore&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
      store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;inmemory
&lt;span class=&quot;co4&quot;&gt;
schema_config&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
  configs&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
    - from&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;2020-10-24&lt;span class=&quot;co3&quot;&gt;
      store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;tsdb&lt;span class=&quot;co3&quot;&gt;
      object_store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;filesystem&lt;span class=&quot;co3&quot;&gt;
      schema&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;v13&lt;span class=&quot;co4&quot;&gt;
      index&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
        prefix&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;index_&lt;span class=&quot;co3&quot;&gt;
        period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;24h
&lt;span class=&quot;co4&quot;&gt;
ruler&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  alertmanager_url&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;http://localhost:9093
&lt;span class=&quot;co4&quot;&gt;
limits_config&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  retention_period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;720h&lt;span class=&quot;co3&quot;&gt;
  reject_old_samples&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;true&lt;span class=&quot;co3&quot;&gt;
  reject_old_samples_max_age&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;720h&lt;span class=&quot;co3&quot;&gt;
  allow_structured_metadata&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;true&lt;span class=&quot;co3&quot;&gt;
  max_query_length&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;721h
  &lt;span class=&quot;co4&quot;&gt;
ingester&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
  lifecycler&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
    ring&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
      kvstore&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
        store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;inmemory&lt;span class=&quot;co3&quot;&gt;
      replication_factor&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1&lt;span class=&quot;co3&quot;&gt;
    final_sleep&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;0s&lt;span class=&quot;co3&quot;&gt;
  chunk_idle_period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1h&lt;span class=&quot;co3&quot;&gt;
  max_chunk_age&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1h&lt;span class=&quot;co3&quot;&gt;
  chunk_target_size&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1048576&lt;span class=&quot;co3&quot;&gt;
  chunk_retain_period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;30s
&lt;span class=&quot;co4&quot;&gt;
table_manager&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  retention_deletes_enabled&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;true&lt;span class=&quot;co3&quot;&gt;
  retention_period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;720h&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;loki_config&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;loki_config&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;11143-12145&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit5&quot; id=&quot;развертывание&quot;&gt;Развертывание&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;version: &lt;span class=&quot;st0&quot;&gt;&amp;quot;3.8&amp;quot;&lt;/span&gt;
&amp;nbsp;
x-logging: &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt;default-logging
  driver: &lt;span class=&quot;st0&quot;&gt;&amp;quot;json-file&amp;quot;&lt;/span&gt;
  options:
    max-size: &lt;span class=&quot;st0&quot;&gt;&amp;quot;10m&amp;quot;&lt;/span&gt;
    max-file: &lt;span class=&quot;st0&quot;&gt;&amp;quot;3&amp;quot;&lt;/span&gt;
    tag: &lt;span class=&quot;st0&quot;&gt;&amp;quot;{{.Name}}/{{.ImageName}}&amp;quot;&lt;/span&gt;
&amp;nbsp;
x-labels: &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt;default-labels
  logging: &lt;span class=&quot;st0&quot;&gt;&amp;quot;enabled&amp;quot;&lt;/span&gt;
  logging_jobname: &lt;span class=&quot;st0&quot;&gt;&amp;quot;docker_swarm&amp;quot;&lt;/span&gt;
  monitoring: &lt;span class=&quot;st0&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;
&amp;nbsp;
services:
  loki:
    image: grafana&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;loki:3.5.8
    ports:
      - &lt;span class=&quot;st0&quot;&gt;&amp;quot;3100:3100&amp;quot;&lt;/span&gt;
    configs:
      - source: loki_config
        target: &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;loki&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;local-config.yaml
    volumes:
      - loki_data:&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;loki
    command: -config.file=&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;loki&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;local-config.yaml
    networks:
      - monitoring
    deploy:
      placement:
        constraints:
          - node.role == manager
    logging: &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;default-logging
    labels:
      &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;: &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;default-labels
      service: &lt;span class=&quot;st0&quot;&gt;&amp;quot;loki&amp;quot;&lt;/span&gt;
      component: &lt;span class=&quot;st0&quot;&gt;&amp;quot;logging&amp;quot;&lt;/span&gt;
&amp;nbsp;
  fluent-bit:
    image: fluent&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit:4.2.0
    configs:
      - source: fluent_bit_config
        target: &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit.conf
      - source: fluent_bit_parser
        target: &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;parsers.conf
      - source: docker_metadata
        target: &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;bin&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;docker-metadata.lua
    environment:
      - &lt;span class=&quot;re2&quot;&gt;NODE_ID&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;.Node.ID&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
      - &lt;span class=&quot;re2&quot;&gt;NODE_NAME&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;.Node.Hostname&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    ports:
      - &lt;span class=&quot;st0&quot;&gt;&amp;quot;5140:5140/tcp&amp;quot;&lt;/span&gt;  &lt;span class=&quot;co0&quot;&gt;# Для приема syslog от роутера&lt;/span&gt;
      - &lt;span class=&quot;st0&quot;&gt;&amp;quot;2020:2020&amp;quot;&lt;/span&gt;      &lt;span class=&quot;co0&quot;&gt;# HTTP мониторинг Fluent Bit&lt;/span&gt;
    networks:
      - monitoring
    volumes:
      - flb_storage:&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;var&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;log&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;flb-storage&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;
      - &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;var&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;lib&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;docker&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;containers:&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;var&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;lib&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;docker&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;containers:ro
    deploy:
      mode: global
&amp;nbsp;
&amp;nbsp;
  grafana:
    image: grafana&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;grafana:12.1.4
    ports:
      - &lt;span class=&quot;st0&quot;&gt;&amp;quot;3000:3000&amp;quot;&lt;/span&gt;
    environment:
      - &lt;span class=&quot;re2&quot;&gt;GF_SECURITY_ADMIN_PASSWORD&lt;/span&gt;=admin
      - &lt;span class=&quot;re2&quot;&gt;GF_SECURITY_ADMIN_USER&lt;/span&gt;=admin
    volumes:
      - grafana_data:&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;var&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;lib&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;grafana
    networks:
      - monitoring
    deploy:
      placement:
        constraints:
          - node.role == manager
    logging: &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;default-logging
    labels:
      &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;: &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;default-labels
      service: &lt;span class=&quot;st0&quot;&gt;&amp;quot;grafana&amp;quot;&lt;/span&gt;
      component: &lt;span class=&quot;st0&quot;&gt;&amp;quot;monitoring&amp;quot;&lt;/span&gt;
&amp;nbsp;
configs:
  loki_config:
    external: &lt;span class=&quot;kw2&quot;&gt;true&lt;/span&gt;
  fluent_bit_config:
    external: &lt;span class=&quot;kw2&quot;&gt;true&lt;/span&gt;
  fluent_bit_parser:
    external: &lt;span class=&quot;kw2&quot;&gt;true&lt;/span&gt;
  docker_metadata:
    external: &lt;span class=&quot;kw2&quot;&gt;true&lt;/span&gt;
&amp;nbsp;
networks:
  monitoring:
    driver: overlay
&amp;nbsp;
volumes:
  flb_storage:
    driver: &lt;span class=&quot;kw3&quot;&gt;local&lt;/span&gt;
  loki_data:
    driver: &lt;span class=&quot;kw3&quot;&gt;local&lt;/span&gt;
  grafana_data:
    driver: &lt;span class=&quot;kw3&quot;&gt;local&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;12146-14449&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit6&quot; id=&quot;проверка_работы&quot;&gt;Проверка работы&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Проверяем конфигурацию&lt;/span&gt;
$ docker &lt;span class=&quot;kw3&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-it&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;fluentbit_container&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;bin&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit &lt;span class=&quot;re5&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit.conf &lt;span class=&quot;re5&quot;&gt;--dry-run&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Смотрим логи&lt;/span&gt;
$ docker service logs logging_fluent-bit
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Проверяем метрики&lt;/span&gt;
$ curl http:&lt;span class=&quot;sy0&quot;&gt;//&lt;/span&gt;localhost:&lt;span class=&quot;nu0&quot;&gt;2020&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;api&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;v1&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;metrics &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; jq
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Тестируем парсеры&lt;/span&gt;
$ &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;2025-11-21T02:13:34.366Z {&amp;quot;method&amp;quot;:&amp;quot;PUT&amp;quot;,&amp;quot;path&amp;quot;:&amp;quot;/projects&amp;quot;,&amp;quot;status&amp;quot;:500}&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; \
$ docker &lt;span class=&quot;kw3&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;fluentbit_container&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;bin&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit &lt;span class=&quot;re5&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit.conf &lt;span class=&quot;re5&quot;&gt;-i&lt;/span&gt; stdin &lt;span class=&quot;re5&quot;&gt;-o&lt;/span&gt; stdout&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430_\u0440\u0430\u0431\u043e\u0442\u044b&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;14450-15067&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit7&quot; id=&quot;запросы_в_grafana&quot;&gt;Запросы в Grafana&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code json&quot;&gt;{job=&amp;quot;fluent-bit&amp;quot;} |= &amp;quot;gitlab&amp;quot;
&amp;nbsp;
{container_name=&amp;quot;gitlab&amp;quot;} 
&amp;nbsp;
{job=&amp;quot;fluent-bit&amp;quot;} |~ &amp;quot;(?i)error|exception|fail&amp;quot;
&amp;nbsp;
{node_name=&amp;quot;node-1&amp;quot;}
&amp;nbsp;
# Все логи GitLab
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} 
&amp;nbsp;
# Логи по компонентам
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | component=&amp;quot;gitaly.UnaryServerInterceptor&amp;quot;
&amp;nbsp;
# Ошибки
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | level=&amp;quot;error&amp;quot;
&amp;nbsp;
# Запросы с определенным correlation_id
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | correlation_id=&amp;quot;01KAJ30DCE4BW6JSAT7KHGZ9PX&amp;quot;
&amp;nbsp;
# Логи Sidekiq
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | severity=&amp;quot;INFO&amp;quot;
&amp;nbsp;
# Все логи GitLab с parsed_data
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json
&amp;nbsp;
# Логи с ошибками
{environment=&amp;quot;production&amp;quot;} | json | level=&amp;quot;error&amp;quot; 
&amp;nbsp;
# Медленные PostgreSQL запросы
{service_name=~&amp;quot;.*postgres.*&amp;quot;} | json | duration &amp;gt; 1000
&amp;nbsp;
# Nginx 5xx ошибки
{container_name=~&amp;quot;.*nginx.*&amp;quot;} | json | status &amp;gt;= 500
&amp;nbsp;
# Sidekiq логи
{container_name=~&amp;quot;.*sidekiq.*&amp;quot;} | json | severity=&amp;quot;INFO&amp;quot;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0432 Grafana&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0437\u0430\u043f\u0440\u043e\u0441\u044b_\u0432_grafana&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:5,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;15068-&amp;quot;} --&gt;</description>
    </item>
    <item rdf:about="http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:docker-swarm-syslog-ng">
        <dc:format>text/html</dc:format>
        <dc:date>2025-12-07T00:56:48+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Обработка логов syslog + Docker</title>
        <link>http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:docker-swarm-syslog-ng</link>
        <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;обработка_логов_syslog_docker&quot;&gt;Обработка логов syslog + Docker&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043b\u043e\u0433\u043e\u0432 syslog + Docker&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430_\u043b\u043e\u0433\u043e\u0432_syslog_docker&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-61&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit2&quot; id=&quot;fluent-bitconf&quot;&gt;fluent-bit.conf&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code ini&quot;&gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;SERVICE&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    flush                     &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;
    log_level                 info
    daemon                    off
    storage.path              /var/log/flb-storage/
    storage.sync              normal
    storage.checksum          off
    storage.max_chunks_up     &lt;span class=&quot;nu0&quot;&gt;128&lt;/span&gt;
    storage.backlog.mem_limit 10M
    parsers_file              parsers.conf
    http_server               on
    http_listen               0.0.0.0
    http_port                 &lt;span class=&quot;nu0&quot;&gt;2020&lt;/span&gt;
    coro_stack_size           &lt;span class=&quot;nu0&quot;&gt;24576&lt;/span&gt;
    plugins_path              /fluent-bit/bin/
&amp;nbsp;
# &lt;span class=&quot;sy0&quot;&gt;====================&lt;/span&gt; ASUS ROUTER SYSLOG INPUT &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;===================&lt;/span&gt;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;INPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name              syslog
    Listen            0.0.0.0
    Port              &lt;span class=&quot;nu0&quot;&gt;5140&lt;/span&gt;
    Parser            syslog-rfc5424
    Tag               router.syslog
    Buffer_Chunk_Size 4MB
    Buffer_Max_Size   16MB
    Mode              tcp
&amp;nbsp;
# &lt;span class=&quot;sy0&quot;&gt;====================&lt;/span&gt; DOCKER LOGS INPUT &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;===================&lt;/span&gt;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;INPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name              tail
    Path              /var/lib/docker/containers/*/*.log
    Parser            docker
    Refresh_Interval  &lt;span class=&quot;nu0&quot;&gt;5&lt;/span&gt;
    Ignore_Older      1h
    Docker_Mode       On
    Tag               docker.&amp;lt;file_name&amp;gt;
    Tag_Regex         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;file_name&amp;gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;a-f0-9&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;-json.log
    Mem_Buf_Limit     50MB
    Skip_Long_Lines   On
    DB                /var/log/flb-storage/flb_db.db
    DB.sync           normal
    Storage.Type      filesystem
    Read_from_Head    false
&amp;nbsp;
# Только для отладки
# &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;INPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
#     Name              tail
#     Path              /var/lib/docker/containers/*/*.log
#     Parser            docker
#     Refresh_Interval  &lt;span class=&quot;nu0&quot;&gt;10&lt;/span&gt;
#     Docker_Mode       On
#     Tag               docker.&amp;lt;file_name&amp;gt;
#     Tag_Regex         &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;?&amp;lt;file_name&amp;gt;&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;a-f0-9&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;*&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;-json.log
#     Mem_Buf_Limit     50MB
#     Skip_Long_Lines   On
#     DB                /var/log/flb-storage/flb_db.db
#     DB.sync           normal
#     Storage.Type      filesystem
#     Read_from_Head    true
&amp;nbsp;
# &lt;span class=&quot;sy0&quot;&gt;====================&lt;/span&gt; DOCKER FILTERS &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;===================&lt;/span&gt;
&amp;nbsp;
# Фильтруем пустые логи
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                grep
    match               docker.*
    Exclude             log ^$
    Exclude             log ^\s*$
    Exclude             log ^&lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt;&amp;gt;.+&amp;lt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;=$&lt;/span&gt;
&amp;nbsp;
# Извлекаем сырой лог
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                modify
    match               docker.*
    copy                log raw_log
    copy                exception.backtrace exception_backtrace
    copy                exception.class exception_class
    copy                exception.message exception_message
&amp;nbsp;
# Очищаем docker.* - оставляем ТОЛЬКО нужные поля
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                record_modifier
    match               docker.*
&amp;nbsp;
    whitelist_key       date
    whitelist_key       log
    whitelist_key       raw_log
    whitelist_key       exception_backtrace
    whitelist_key       exception_class
    whitelist_key       exception_message
&amp;nbsp;
    whitelist_key       method
    whitelist_key       path
    whitelist_key       action
    whitelist_key       status
    whitelist_key       remote_ip
    whitelist_key       controller
    whitelist_key       line_id
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              nginx_access
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              gitlab_json
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              gitlab_registry
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              sidekiq_json
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              mysql_error
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              mysql_slow
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              postgresql
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              postgresql_detailed
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              nextcloud_access
    reserve_data        true
    Preserve_Key        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              apache_access
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              php_fpm
    reserve_data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                parser
    match               docker.*
    key_name            raw_log
    parser              grafana_regex
    reserve_data        true
&amp;nbsp;
# Структуризация распарсенных полей В raw_log
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                nest
    match               docker.*
    operation           nest
    wildcard            remote_*
    wildcard            method
    wildcard            path
    wildcard            status
    wildcard            body_bytes
    wildcard            user_agent
    wildcard            referrer
    wildcard            logger
    wildcard            endpoint
    wildcard            pluginId
    wildcard            dsName
    wildcard            dsUID
    wildcard            uname
    wildcard            level
    wildcard            msg
    wildcard            statusCode
    wildcard            resourcePath
    wildcard            exception
    nest_under          parsed_data
&amp;nbsp;
# Метаданные Docker
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                lua
    match               docker.*
    script              /fluent-bit/bin/docker-metadata.lua
    call                enrich_with_docker_metadata
&amp;nbsp;
# Копируем метаданные
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                modify
    match               docker.*
    copy                docker.hostname hostname
    copy                docker.container_started started
    copy                docker.container_name container_name
    copy                docker.container_name service_name
    copy                docker.container_id container_id
    copy                docker.state state
    copy                docker.stream stream
    copy                docker.line_id line_id
&amp;nbsp;
    copy                log _raw
    copy                parsed_data _parsed
    # copy                exception_class _class
    # copy                exception_message _message
    # copy                exception_backtrace _backtrace
&amp;nbsp;
    copy                docker.label_project project
    copy                docker.label_service service
    copy                docker.label_logging logging
    copy                docker.label_logging_jobname logging_jobname
&amp;nbsp;
# Структурируем через nest
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                nest
    match               docker.*
    operation           nest
    wildcard            _*
    nest_under          log
    remove_prefix       _
&amp;nbsp;
# Добавляем host metadata
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                modify
    match               docker.*
    set                 node_id $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;NODE_ID&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    set                 node_name $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;NODE_NAME&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    set                 host_name $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;NODE_NAME&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
# Перетагиваем только логи с enabled logging
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                rewrite_tag
    match               docker.*
    rule                $logging ^enabled$ data.$container_id true
&amp;nbsp;
# &lt;span class=&quot;sy0&quot;&gt;====================&lt;/span&gt; ROUTER FILTERS &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;===================&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name                parser
    Match               router.*
    Key_Name            message
    Parser              router_logs
    Reserve_Data        true
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name                record_modifier
    Match               router.*
    Record              hostname $&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;HOSTNAME&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    Record              device_type router
    Record              source asus_merlin
    Record              cluster docker_swarm
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name                modify
    Match               router.*
    Rename              host source_host
    Rename              ident facility
    Set                 log_type syslog
    Set                 environment production
&amp;nbsp;
# Отфильтровываем служебные контейнеры
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name                grep
    Match               docker.*
    Exclude             container_name ^/loki.*
    Exclude             container_name ^/fluent-bit.*
    Exclude             container_name ^/grafana.*
    Exclude             container_name ^/traefik.*
&amp;nbsp;
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;FILTER&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                record_modifier
    match               data.*
&amp;nbsp;
    whitelist_key       date
    whitelist_key       log
    whitelist_key       exception_class
    whitelist_key       exception_message
    whitelist_key       exception_backtrace
&amp;nbsp;
    whitelist_key       method
    whitelist_key       path
    whitelist_key       action
    whitelist_key       status
    whitelist_key       remote_ip
    whitelist_key       controller
    whitelist_key       line_id
&amp;nbsp;
    whitelist_key       node_id
    whitelist_key       node_name
    whitelist_key       host_name
    whitelist_key       hostname
    whitelist_key       started
    whitelist_key       container_name
    whitelist_key       service_name
    whitelist_key       container_id
    whitelist_key       stream
    whitelist_key       project
    whitelist_key       service
    whitelist_key       logging_jobname
&amp;nbsp;
# Логи docker в Loki
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;OUTPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    name                loki
    match               data.*
    host                loki
    port                &lt;span class=&quot;nu0&quot;&gt;3100&lt;/span&gt;
    labels              job&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;$logging_jobname, node_name=$node_name, container_id=$container_id, container_name=$container_name, service_name=$service_name, project=$project, service=$service, level=$stream&lt;/span&gt;
    line_format         json
    auto_kubernetes_labels off
&amp;nbsp;
# Логи роутера в Loki
&lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;OUTPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
    Name                loki
    Match               router.*
    Host                loki
    Port                &lt;span class=&quot;nu0&quot;&gt;3100&lt;/span&gt;
    Labels              job&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;re2&quot;&gt;asus_router, device_type=router, source=syslog, cluster=docker_swarm&lt;/span&gt;
    Line_Format         key_value
    Auto_Kubernetes_Labels off
&amp;nbsp;
# Только для отладки
# &lt;span class=&quot;re0&quot;&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;OUTPUT&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/span&gt;
#     name                stdout
#     match               data.*
#     format              json&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;fluent-bit.conf&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;fluent-bitconf&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;62-10911&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit3&quot; id=&quot;loki_config&quot;&gt;loki_config&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code yaml&quot;&gt;&lt;span class=&quot;co3&quot;&gt;auth_enabled&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;false
&lt;span class=&quot;co4&quot;&gt;
server&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  http_listen_port&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;3100
&lt;span class=&quot;co4&quot;&gt;
common&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  instance_addr&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;127.0.0.1&lt;span class=&quot;co3&quot;&gt;
  path_prefix&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;/loki&lt;span class=&quot;co4&quot;&gt;
  storage&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
    filesystem&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
      chunks_directory&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;/loki/chunks&lt;span class=&quot;co3&quot;&gt;
      rules_directory&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;/loki/rules&lt;span class=&quot;co3&quot;&gt;
  replication_factor&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1&lt;span class=&quot;co4&quot;&gt;
  ring&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
    kvstore&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
      store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;inmemory
&lt;span class=&quot;co4&quot;&gt;
schema_config&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
  configs&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
    - from&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;2020-10-24&lt;span class=&quot;co3&quot;&gt;
      store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;tsdb&lt;span class=&quot;co3&quot;&gt;
      object_store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;filesystem&lt;span class=&quot;co3&quot;&gt;
      schema&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;v13&lt;span class=&quot;co4&quot;&gt;
      index&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
        prefix&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;index_&lt;span class=&quot;co3&quot;&gt;
        period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;24h
&lt;span class=&quot;co4&quot;&gt;
ruler&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  alertmanager_url&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;http://localhost:9093
&lt;span class=&quot;co4&quot;&gt;
limits_config&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  retention_period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;720h&lt;span class=&quot;co3&quot;&gt;
  reject_old_samples&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;true&lt;span class=&quot;co3&quot;&gt;
  reject_old_samples_max_age&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;720h&lt;span class=&quot;co3&quot;&gt;
  allow_structured_metadata&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;true&lt;span class=&quot;co3&quot;&gt;
  max_query_length&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;721h
  &lt;span class=&quot;co4&quot;&gt;
ingester&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
  lifecycler&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
    ring&lt;/span&gt;:&lt;span class=&quot;co4&quot;&gt;
      kvstore&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
        store&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;inmemory&lt;span class=&quot;co3&quot;&gt;
      replication_factor&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1&lt;span class=&quot;co3&quot;&gt;
    final_sleep&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;0s&lt;span class=&quot;co3&quot;&gt;
  chunk_idle_period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1h&lt;span class=&quot;co3&quot;&gt;
  max_chunk_age&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1h&lt;span class=&quot;co3&quot;&gt;
  chunk_target_size&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;1048576&lt;span class=&quot;co3&quot;&gt;
  chunk_retain_period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;30s
&lt;span class=&quot;co4&quot;&gt;
table_manager&lt;/span&gt;:&lt;span class=&quot;co3&quot;&gt;
  retention_deletes_enabled&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;true&lt;span class=&quot;co3&quot;&gt;
  retention_period&lt;/span&gt;&lt;span class=&quot;sy2&quot;&gt;: &lt;/span&gt;720h&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;loki_config&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;loki_config&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;10912-11914&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit4&quot; id=&quot;развертывание&quot;&gt;Развертывание&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;version: &lt;span class=&quot;st0&quot;&gt;&amp;quot;3.8&amp;quot;&lt;/span&gt;
&amp;nbsp;
x-logging: &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt;default-logging
  driver: &lt;span class=&quot;st0&quot;&gt;&amp;quot;json-file&amp;quot;&lt;/span&gt;
  options:
    max-size: &lt;span class=&quot;st0&quot;&gt;&amp;quot;10m&amp;quot;&lt;/span&gt;
    max-file: &lt;span class=&quot;st0&quot;&gt;&amp;quot;3&amp;quot;&lt;/span&gt;
    tag: &lt;span class=&quot;st0&quot;&gt;&amp;quot;{{.Name}}/{{.ImageName}}&amp;quot;&lt;/span&gt;
&amp;nbsp;
x-labels: &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt;default-labels
  logging: &lt;span class=&quot;st0&quot;&gt;&amp;quot;enabled&amp;quot;&lt;/span&gt;
  logging_jobname: &lt;span class=&quot;st0&quot;&gt;&amp;quot;docker_swarm&amp;quot;&lt;/span&gt;
  monitoring: &lt;span class=&quot;st0&quot;&gt;&amp;quot;true&amp;quot;&lt;/span&gt;
&amp;nbsp;
services:
  loki:
    image: grafana&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;loki:3.5.8
    ports:
      - &lt;span class=&quot;st0&quot;&gt;&amp;quot;3100:3100&amp;quot;&lt;/span&gt;
    configs:
      - source: loki_config
        target: &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;loki&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;local-config.yaml
    volumes:
      - loki_data:&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;loki
    command: -config.file=&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;loki&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;local-config.yaml
    networks:
      - monitoring
    deploy:
      placement:
        constraints:
          - node.role == manager
    logging: &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;default-logging
    labels:
      &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;: &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;default-labels
      service: &lt;span class=&quot;st0&quot;&gt;&amp;quot;loki&amp;quot;&lt;/span&gt;
      component: &lt;span class=&quot;st0&quot;&gt;&amp;quot;logging&amp;quot;&lt;/span&gt;
&amp;nbsp;
  fluent-bit:
    image: fluent&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit:4.2.0
    configs:
      - source: fluent_bit_config
        target: &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit.conf
      - source: fluent_bit_parser
        target: &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;parsers.conf
      - source: docker_metadata
        target: &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;bin&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;docker-metadata.lua
    environment:
      - &lt;span class=&quot;re2&quot;&gt;NODE_ID&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;.Node.ID&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
      - &lt;span class=&quot;re2&quot;&gt;NODE_NAME&lt;/span&gt;=&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;.Node.Hostname&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
    ports:
      - &lt;span class=&quot;st0&quot;&gt;&amp;quot;5140:5140/tcp&amp;quot;&lt;/span&gt;  &lt;span class=&quot;co0&quot;&gt;# Для приема syslog от роутера&lt;/span&gt;
      - &lt;span class=&quot;st0&quot;&gt;&amp;quot;2020:2020&amp;quot;&lt;/span&gt;      &lt;span class=&quot;co0&quot;&gt;# HTTP мониторинг Fluent Bit&lt;/span&gt;
    networks:
      - monitoring
    volumes:
      - flb_storage:&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;var&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;log&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;flb-storage&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;
      - &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;var&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;lib&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;docker&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;containers:&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;var&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;lib&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;docker&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;containers:ro
    deploy:
      mode: global
&amp;nbsp;
&amp;nbsp;
  grafana:
    image: grafana&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;grafana:12.1.4
    ports:
      - &lt;span class=&quot;st0&quot;&gt;&amp;quot;3000:3000&amp;quot;&lt;/span&gt;
    environment:
      - &lt;span class=&quot;re2&quot;&gt;GF_SECURITY_ADMIN_PASSWORD&lt;/span&gt;=admin
      - &lt;span class=&quot;re2&quot;&gt;GF_SECURITY_ADMIN_USER&lt;/span&gt;=admin
    volumes:
      - grafana_data:&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;var&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;lib&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;grafana
    networks:
      - monitoring
    deploy:
      placement:
        constraints:
          - node.role == manager
    logging: &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;default-logging
    labels:
      &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt;: &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;default-labels
      service: &lt;span class=&quot;st0&quot;&gt;&amp;quot;grafana&amp;quot;&lt;/span&gt;
      component: &lt;span class=&quot;st0&quot;&gt;&amp;quot;monitoring&amp;quot;&lt;/span&gt;
&amp;nbsp;
configs:
  loki_config:
    external: &lt;span class=&quot;kw2&quot;&gt;true&lt;/span&gt;
  fluent_bit_config:
    external: &lt;span class=&quot;kw2&quot;&gt;true&lt;/span&gt;
  fluent_bit_parser:
    external: &lt;span class=&quot;kw2&quot;&gt;true&lt;/span&gt;
  docker_metadata:
    external: &lt;span class=&quot;kw2&quot;&gt;true&lt;/span&gt;
&amp;nbsp;
networks:
  monitoring:
    driver: overlay
&amp;nbsp;
volumes:
  flb_storage:
    driver: &lt;span class=&quot;kw3&quot;&gt;local&lt;/span&gt;
  loki_data:
    driver: &lt;span class=&quot;kw3&quot;&gt;local&lt;/span&gt;
  grafana_data:
    driver: &lt;span class=&quot;kw3&quot;&gt;local&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;11915-14218&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit5&quot; id=&quot;проверка_работы&quot;&gt;Проверка работы&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&lt;span class=&quot;co0&quot;&gt;# Проверяем конфигурацию&lt;/span&gt;
$ docker &lt;span class=&quot;kw3&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-it&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;fluentbit_container&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;bin&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit &lt;span class=&quot;re5&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit.conf &lt;span class=&quot;re5&quot;&gt;--dry-run&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Смотрим логи&lt;/span&gt;
$ docker service logs logging_fluent-bit
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Проверяем метрики&lt;/span&gt;
$ curl http:&lt;span class=&quot;sy0&quot;&gt;//&lt;/span&gt;localhost:&lt;span class=&quot;nu0&quot;&gt;2020&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;api&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;v1&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;metrics &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; jq
&amp;nbsp;
&lt;span class=&quot;co0&quot;&gt;# Тестируем парсеры&lt;/span&gt;
$ &lt;span class=&quot;kw3&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;st_h&quot;&gt;&#039;2025-11-21T02:13:34.366Z {&amp;quot;method&amp;quot;:&amp;quot;PUT&amp;quot;,&amp;quot;path&amp;quot;:&amp;quot;/projects&amp;quot;,&amp;quot;status&amp;quot;:500}&#039;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;|&lt;/span&gt; \
$ docker &lt;span class=&quot;kw3&quot;&gt;exec&lt;/span&gt; &lt;span class=&quot;re5&quot;&gt;-i&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt;fluentbit_container&lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;bin&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit &lt;span class=&quot;re5&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;etc&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;fluent-bit.conf &lt;span class=&quot;re5&quot;&gt;-i&lt;/span&gt; stdin &lt;span class=&quot;re5&quot;&gt;-o&lt;/span&gt; stdout&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430_\u0440\u0430\u0431\u043e\u0442\u044b&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;14219-14836&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit6&quot; id=&quot;запросы_в_grafana&quot;&gt;Запросы в Grafana&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code json&quot;&gt;{job=&amp;quot;fluent-bit&amp;quot;} |= &amp;quot;gitlab&amp;quot;
&amp;nbsp;
{container_name=&amp;quot;gitlab&amp;quot;} 
&amp;nbsp;
{job=&amp;quot;fluent-bit&amp;quot;} |~ &amp;quot;(?i)error|exception|fail&amp;quot;
&amp;nbsp;
{node_name=&amp;quot;node-1&amp;quot;}
&amp;nbsp;
# Все логи GitLab
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} 
&amp;nbsp;
# Логи по компонентам
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | component=&amp;quot;gitaly.UnaryServerInterceptor&amp;quot;
&amp;nbsp;
# Ошибки
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | level=&amp;quot;error&amp;quot;
&amp;nbsp;
# Запросы с определенным correlation_id
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | correlation_id=&amp;quot;01KAJ30DCE4BW6JSAT7KHGZ9PX&amp;quot;
&amp;nbsp;
# Логи Sidekiq
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | severity=&amp;quot;INFO&amp;quot;
&amp;nbsp;
# Все логи GitLab с parsed_data
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json
&amp;nbsp;
# Логи с ошибками
{environment=&amp;quot;production&amp;quot;} | json | level=&amp;quot;error&amp;quot; 
&amp;nbsp;
# Медленные PostgreSQL запросы
{service_name=~&amp;quot;.*postgres.*&amp;quot;} | json | duration &amp;gt; 1000
&amp;nbsp;
# Nginx 5xx ошибки
{container_name=~&amp;quot;.*nginx.*&amp;quot;} | json | status &amp;gt;= 500
&amp;nbsp;
# Sidekiq логи
{container_name=~&amp;quot;.*sidekiq.*&amp;quot;} | json | severity=&amp;quot;INFO&amp;quot;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0432 Grafana&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0437\u0430\u043f\u0440\u043e\u0441\u044b_\u0432_grafana&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;14837-&amp;quot;} --&gt;</description>
    </item>
    <item rdf:about="http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:example">
        <dc:format>text/html</dc:format>
        <dc:date>2025-11-26T00:30:31+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>Обработка многострочных логов</title>
        <link>http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:example</link>
        <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;обработка_многострочных_логов&quot;&gt;Обработка многострочных логов&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0445 \u043b\u043e\u0433\u043e\u0432&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430_\u043c\u043d\u043e\u0433\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0445_\u043b\u043e\u0433\u043e\u0432&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-72&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit2&quot; id=&quot;fluent-bitconf&quot;&gt;fluent-bit.conf&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code ini&quot;&gt;&amp;nbsp;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;fluent-bit.conf&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;fluent-bitconf&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;73-118&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit3&quot; id=&quot;parsers_multilineconf&quot;&gt;parsers_multiline.conf&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code ini&quot;&gt;&amp;nbsp;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;parsers_multiline.conf&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;parsers_multilineconf&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:1,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;119-171&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit4&quot; id=&quot;установка&quot;&gt;Установка&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&amp;nbsp;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;172-221&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit5&quot; id=&quot;loki_config&quot;&gt;loki_config&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code yaml&quot;&gt;&amp;nbsp;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;loki_config&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;loki_config&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;222-264&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit6&quot; id=&quot;развертывание&quot;&gt;Развертывание&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&amp;nbsp;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0420\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u0435&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;265-322&amp;quot;} --&gt;
&lt;h4 class=&quot;sectionedit7&quot; id=&quot;проверка_работы&quot;&gt;Проверка работы&lt;/h4&gt;
&lt;div class=&quot;level4&quot;&gt;
&lt;pre class=&quot;code bash&quot;&gt;&amp;nbsp;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430_\u0440\u0430\u0431\u043e\u0442\u044b&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:5,&amp;quot;secid&amp;quot;:7,&amp;quot;range&amp;quot;:&amp;quot;323-383&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit8&quot; id=&quot;запросы_в_grafana&quot;&gt;Запросы в Grafana&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;code&quot;&gt;{job=&amp;quot;fluent-bit&amp;quot;} |= &amp;quot;gitlab&amp;quot;&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;{container_name=&amp;quot;gitlab&amp;quot;} &lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;{job=&amp;quot;fluent-bit&amp;quot;} |~ &amp;quot;(?i)error|exception|fail&amp;quot;&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;{node_name=&amp;quot;node-1&amp;quot;}&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# Все логи GitLab
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} &lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# Логи по компонентам
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | component=&amp;quot;gitaly.UnaryServerInterceptor&amp;quot;&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# Ошибки
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | level=&amp;quot;error&amp;quot;&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# Запросы с определенным correlation_id
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | correlation_id=&amp;quot;01KAJ30DCE4BW6JSAT7KHGZ9PX&amp;quot;&lt;/pre&gt;
&lt;pre class=&quot;code&quot;&gt;# Логи Sidekiq
{container_name=~&amp;quot;.*gitlab.*&amp;quot;} | json | severity=&amp;quot;INFO&amp;quot;&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0417\u0430\u043f\u0440\u043e\u0441\u044b \u0432 Grafana&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0437\u0430\u043f\u0440\u043e\u0441\u044b_\u0432_grafana&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:6,&amp;quot;secid&amp;quot;:8,&amp;quot;range&amp;quot;:&amp;quot;384-&amp;quot;} --&gt;</description>
    </item>
    <item rdf:about="http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:start">
        <dc:format>text/html</dc:format>
        <dc:date>2025-11-26T00:28:46+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title></title>
        <link>http://178.140.10.58:8080/doku.php?id=software:fluent-bit-loki-grafana:fluent-bit:start</link>
        <description>&lt;div class=&quot;noteredirect&quot;&gt;Страница была перемещена по адресу &lt;a href=&quot;http://178.140.10.58:8080/doku.php?id=software:monitoring:fluent-bit&quot; class=&quot;wikilink1&quot; title=&quot;software:monitoring:fluent-bit&quot; data-wiki-id=&quot;software:monitoring:fluent-bit&quot;&gt;Fluent-Bit&lt;/a&gt;.&lt;/div&gt;</description>
    </item>
</rdf:RDF>
