%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /backups/router/usr/local/share/syslog-ng/include/scl/arr/
Upload File :
Create Path :
Current File : //backups/router/usr/local/share/syslog-ng/include/scl/arr/arr.conf

#############################################################################
# Copyright (c) 2024 Attila Szakacs
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published
# by the Free Software Foundation, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
#
# As an additional exemption you are allowed to compile & link against the
# OpenSSL libraries as published by the OpenSSL project. See the file
# COPYING for details.
#
#############################################################################
#
# Example log:
# 2024-01-26 17:20:01.5|Info|ImportListSyncService|Import List Sync Completed. Items found: 1, Series added: 0

block parser arr_internal(
  program()
  prefix()
)
{
  channel {
    parser {
      regexp-parser(
        patterns('^([^|]*)\|([^|]*)\|([^|]*)\|(?<MESSAGE>(?:.|\n)*)')
      );
      date-parser(
        template("$1")
        format("%Y-%m-%d %H:%M:%S.%f")
      );
    };

    rewrite {
      set("`program`" value("PROGRAM"));
      set-severity("$2");
      set("$3" value("`prefix`module"));
    };
  };
};

block source arr_internal(
  program()
  dir()
  filename()
  prefix()
  ...)
{
  channel {
    source {
      file(
        "`dir`/`filename`"
        multi-line-mode(regexp)
        multi-line-prefix('^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{1}')
        multi-line-timeout(2)
        flags(no-parse)
        `__VARARGS__`
      );
    };
    parser {
      arr_internal(
        program("`program`")
        prefix("`prefix`")
      );
    };
  };
};

block source radarr(
  dir()
  prefix(".radarr.")
)
{
  arr_internal(
    program("Radarr")
    dir("`dir`")
    filename("radarr.txt")
    prefix("`prefix`")
  );
};

block source sonarr(
  dir()
  prefix(".sonarr.")
)
{
  arr_internal(
    program("Sonarr")
    dir("`dir`")
    filename("sonarr.txt")
    prefix("`prefix`")
  );
};

block source lidarr(
  dir()
  prefix(".lidarr.")
)
{
  arr_internal(
    program("Lidarr")
    dir("`dir`")
    filename("lidarr.txt")
    prefix("`prefix`")
  );
};

block source prowlarr(
  dir()
  prefix(".prowlarr.")
)
{
  arr_internal(
    program("Prowlarr")
    dir("`dir`")
    filename("prowlarr.txt")
    prefix("`prefix`")
  );
};

block source readarr(
  dir()
  prefix(".readarr.")
)
{
  arr_internal(
    program("Readarr")
    dir("`dir`")
    filename("readarr.txt")
    prefix("`prefix`")
  );
};

block source whisparr(
  dir()
  prefix(".whisparr.")
)
{
  arr_internal(
    program("Whisparr")
    dir("`dir`")
    filename("whisparr.txt")
    prefix("`prefix`")
  );
};

Zerion Mini Shell 1.0