ietf-syslog

This module contains a collection of YANG definitions for syslog configuration. Copyright (c) 2016 IETF Trust and the persons i...

  • Version: 2016-07-08

    ietf-syslog@2016-07-08


    
      module ietf-syslog {
    
        yang-version 1;
    
        namespace
          "urn:ietf:params:xml:ns:yang:ietf-syslog";
    
        prefix syslog;
    
        import ietf-inet-types {
          prefix inet;
        }
        import ietf-interfaces {
          prefix if;
        }
        import ietf-syslog-types {
          prefix syslogtypes;
        }
    
        organization
          "IETF NETMOD (NETCONF Data Modeling Language) 
         Working Group";
    
        contact
          "WG Web:   <http://tools.ietf.org/wg/netmod/>
         WG List:  <mailto:netmod@ietf.org>
         
         WG Chair: Lou Berger
                   <mailto:lberger@labn.net>
         
         WG Chair: Kent Watsen
                   <mailto:kwatsen@juniper.net>
         
         Editor:   Kiran Agrahara Sreenivasa
                   <mailto:kkoushik@cisco.com>
         
         Editor:   Clyde Wildes
                   <mailto:cwildes@cisco.com>";
    
        description
          "This module contains a collection of YANG definitions 
         for syslog configuration.
         
         Copyright (c) 2016 IETF Trust and the persons identified as
         authors of the code. All rights reserved.
         
         Redistribution and use in source and binary forms, with or
         without modification, is permitted pursuant to, and subject to
         the license terms contained in, the Simplified BSD License set
         forth in Section 4.c of the IETF Trust's Legal Provisions
         Relating to IETF Documents
         (http://trustee.ietf.org/license-info).
         
         The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
         NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and
         'OPTIONAL' in the module text are to be interpreted as described
         in RFC 2119 (http://tools.ietf.org/html/rfc2119).
         
         This version of this YANG module is part of RFC XXXX
         (http://tools.ietf.org/html/rfcXXXX); see the RFC itself for
         full legal notices.";
    
        reference
          "RFC 5424: The Syslog Protocol
           RFC 5425: Transport Layer Security (TLS) Transport Mapping for Syslog
           RFC 5426: Transmission of Syslog Messages over UDP
           RFC 6587: Transmission of Syslog Messages over TCP
           RFC 5848: Signed Syslog Messages";
    
    
        revision "2016-07-08" {
          description "Initial Revision";
          reference
            "RFC XXXX: Syslog YANG Model";
    
        }
    
    
        feature buffer-limit-bytes {
          description
            "This feature indicates that local memory logging buffers
           are limited in size using a limit expressed in bytes.";
        }
    
        feature buffer-limit-messages {
          description
            "This feature indicates that local memory logging buffers
           are limited in size using a limit expressed in number
           of log messages.";
        }
    
        feature file-limit-size {
          description
            "This feature indicates that file logging resources
           are managed using size and number limits.";
        }
    
        feature file-limit-duration {
          description
            "This feature indicates that file logging resources
           are managed using time based limits.";
        }
    
        feature select-sev-compare {
          description
            "This feature represents the ability to select messages 
           using the additional operators equal to, or not equal to 
           when comparing the syslog message severity.";
        }
    
        feature select-match {
          description
            "This feature represents the ability to select messages based
           on a Posix 1003.2 regular expression pattern match.";
        }
    
        feature structured-data {
          description
            "This feature represents the ability to log messages 
           in structured-data format as per RFC 5424.";
        }
    
        feature signed-messages {
          description
            "This feature represents the ability to configure signed 
           syslog messages according to RFC 5848.";
        }
    
        grouping log-severity {
          description
            "This grouping defines the severity value that is used to 
           select log messages.";
          leaf severity {
            type union {
              type syslogtypes:severity;
              type enumeration {
                enum "all" {
                  value -1;
                  description
                    "This enum describes the case where all severities 
                   are selected.";
                }
                enum "none" {
                  value -2;
                  description
                    "This enum describes the case where no severities 
                   are selected.";
                }
              }
            }
            mandatory true;
            description
              "This leaf specifies the syslog message severity. When 
             severity is specified, the default severity comparison 
             is all messages of the specified severity and greater are 
             selected. 'all' is a special case which means all severities
             are selected. 'none' is a special case which means that
             no selection should occur or disable this filter.";
          }
    
          leaf compare-op {
            when
              "../severity != \"all\" and
                        ../severity != \"none\"" {
              description
                "The compare-op is not applicable for severity 'all' or 
               severity 'none'";
            }
            if-feature select-sev-compare;
            type enumeration {
              enum "equals-or-higher" {
                value 0;
                description
                  "This enum specifies all messages of the specified 
                 severity and higher are logged according to the 
                 given log-action";
              }
              enum "equals" {
                value 1;
                description
                  "This enum specifies all messages that are for 
                 the specified severity are logged according to the 
                 given log-action";
              }
              enum "not-equals" {
                value 2;
                description
                  "This enum specifies all messages that are not for 
                 the specified severity are logged according to the 
                 given log-action";
              }
            }
            default "equals-or-higher";
            description
              "This leaf describes the option to specify how the 
             severity comparison is performed.";
          }
        }  // grouping log-severity
    
        grouping selector {
          description
            "This grouping defines a syslog selector which is used to 
           select log messages for the log-action (buffer, file, 
           etc). Choose one of the following:
             no-log-facility
             log-facility [<facility> <severity>...]";
          container log-selector {
            description
              "This container describes the log selector parameters 
             for syslog.";
            choice selector-facility {
              mandatory true;
              description
                "This choice describes the option to specify no 
               facilities, or a specific facility which can be
               all for all facilities.";
              case no-log-facility {
                description
                  "This case specifies no facilities will match when 
                 comparing the syslog message facility. This is a 
                 method that can be used to effectively disable a 
                 particular log-action (buffer, file, etc).";
                leaf no-facilities {
                  type empty;
                  description
                    "This leaf specifies that no facilities are selected 
                   for this log-action.";
                }
              }  // case no-log-facility
    
              case log-facility {
                description
                  "This case specifies one or more specified facilities 
                 will match when comparing the syslog message facility.";
                list log-facility {
                  key "facility";
                  description
                    "This list describes a collection of syslog 
                   facilities and severities.";
                  leaf facility {
                    type union {
                      type identityref {
                        base syslogtypes:syslog-facility;
                      }
                      type enumeration {
                        enum "all" {
                          value 0;
                          description
                            "This enum describes the case where all 
                           facilities are requested.";
                        }
                      }
                    }
                    description
                      "The leaf uniquely identifies a syslog facility.";
                  }
    
                  uses log-severity;
                }  // list log-facility
              }  // case log-facility
            }  // choice selector-facility
    
            leaf pattern-match {
              if-feature select-match;
              type string;
              description
                "This leaf desribes a Posix 1003.2 regular expression 
               string that can be used to select a syslog message for 
               logging. The match is performed on the RFC 5424 
               SYSLOG-MSG field.";
            }
          }  // container log-selector
        }  // grouping selector
    
        grouping structured-data {
          description
            "This grouping defines the syslog structured data option 
           which is used to select the format used to write log 
           messages.";
          leaf structured-data {
            if-feature structured-data;
            type boolean;
            default "false";
            description
              "This leaf describes how log messages are written to 
             the log file. If true, messages will be written 
             with one or more STRUCTURED-DATA elements as per 
             RFC5424; if false, messages will be written with 
             STRUCTURED-DATA = NILVALUE.";
          }
        }  // grouping structured-data
    
        container syslog {
          description
            "This container describes the configuration parameters for 
           syslog.";
          container actions {
            description
              "This container describes the log-action parameters 
             for syslog.";
            container console {
              presence
                "Enables logging console configuration";
              description
                "This container describes the configuration parameters for 
               console logging.";
              uses selector;
            }  // container console
    
            container buffer {
              description
                "This container describes the configuration parameters for 
               local memory buffer logging. The buffer is circular in 
               nature, so newer messages overwrite older messages after 
               the buffer is filled. The method used to read syslog messages
               from the buffer is supplied by the local implementation.";
              uses selector;
    
              leaf buffer-limit-bytes {
                if-feature buffer-limit-bytes;
                type uint64;
                units "bytes";
                description
                  "This leaf configures the amount of memory (in bytes) that 
                 will be dedicated to the local memory logging buffer. 
                 The default value varies by implementation.";
              }
    
              leaf buffer-limit-messages {
                if-feature buffer-limit-messages;
                type uint64;
                units "log messages";
                description
                  "This leaf configures the number of log messages that 
                 will be dedicated to the local memory logging buffer. 
                 The default value varies by implementation.";
              }
    
              uses structured-data;
            }  // container buffer
    
            container file {
              description
                "This container describes the configuration parameters for 
               file logging. If file-archive limits are not supplied, it
               is assumed that the local implementation defined limits will 
               be used.";
              list log-file {
                key "name";
                description
                  "This list describes a collection of local logging 
                 files.";
                leaf name {
                  type inet:uri {
                    pattern "file:.*";
                  }
                  description
                    "This leaf specifies the name of the log file which 
                   MUST use the uri scheme file:.";
                }
    
                uses selector;
    
                uses structured-data;
    
                container file-archive {
                  description
                    "This container describes the configuration 
                   parameters for log file archiving.";
                  leaf number-of-files {
                    if-feature file-limit-size;
                    type uint32;
                    description
                      "This leaf specifies the maximum number of log 
                     files retained. Specify 1 for implementations 
                     that only support one log file.";
                  }
    
                  leaf max-file-size {
                    if-feature file-limit-size;
                    type uint64;
                    units "megabytes";
                    description
                      "This leaf specifies the maximum log file size.";
                  }
    
                  leaf rollover {
                    if-feature file-limit-duration;
                    type uint32;
                    units "minutes";
                    description
                      "This leaf specifies the length of time that log 
                     events should be written to a specific log file. 
                     Log events that arrive after the rollover period 
                     cause the current log file to be closed and a new 
                     log file to be opened.";
                  }
    
                  leaf retention {
                    if-feature file-limit-duration;
                    type uint16;
                    units "hours";
                    description
                      "This leaf specifies the length of time that 
                     completed/closed log event files should be stored 
                     in the file system before they are deleted.";
                  }
                }  // container file-archive
              }  // list log-file
            }  // container file
    
            container remote {
              description
                "This container describes the configuration parameters for 
               forwarding syslog messages to remote relays or collectors.";
              list destination {
                key "name";
                description
                  "This list describes a collection of remote logging 
                 destinations.";
                leaf name {
                  type string;
                  description
                    "An arbitrary name for the endpoint to connect to.";
                }
    
                choice transport {
                  mandatory true;
                  description
                    "This choice describes the transport option.";
                  container tcp {
                    description
                      "This container describes the TCP transport
                       options.";
                    reference
                      "RFC 6587: Transmission of Syslog Messages over TCP";
    
                    leaf address {
                      type inet:host;
                      description
                        "The leaf uniquely specifies the address of 
                         the remote host. One of the following must 
                         be specified: an ipv4 address, an ipv6 
                         address, or a host name.";
                    }
    
                    leaf port {
                      type inet:port-number;
                      default "514";
                      description
                        "This leaf specifies the port number used to 
                         deliver messages to the remote server.";
                    }
                  }  // container tcp
                  container udp {
                    description
                      "This container describes the UDP transport
                       options.";
                    reference
                      "RFC 5426: Transmission of Syslog Messages over UDP";
    
                    leaf address {
                      type inet:host;
                      description
                        "The leaf uniquely specifies the address of 
                         the remote host. One of the following must be 
                         specified: an ipv4 address, an ipv6 address, 
                         or a host name.";
                    }
    
                    leaf port {
                      type inet:port-number;
                      default "514";
                      description
                        "This leaf specifies the port number used to 
                         deliver messages to the remote server.";
                    }
                  }  // container udp
                  container tls {
                    description
                      "This container describes the TLS transport options.";
                    reference
                      "RFC 5425: Transport Layer Security (TLS) Transport
                      Mapping for Syslog ";
    
                  }  // container tls
                }  // choice transport
    
                uses selector;
    
                leaf destination-facility {
                  type identityref {
                    base syslogtypes:syslog-facility;
                  }
                  default "syslogtypes:local7";
                  description
                    "This leaf specifies the facility used in messages 
                   delivered to the remote server.";
                }
    
                leaf source-interface {
                  type if:interface-ref;
                  description
                    "This leaf sets the source interface for the remote 
                   syslog server. Either the interface name or the 
                   interface IP address can be specified. If not set, 
                   messages sent to a remote syslog server will 
                   contain the IP address of the interface the syslog 
                   message uses to exit the network element";
                }
    
                uses structured-data;
    
                container syslog-sign {
                  if-feature signed-messages;
                  presence
                    "If present, syslog-sign is activated.";
                  description
                    "This container describes the configuration 
                   parameters for signed syslog messages as described 
                   by RFC 5848.";
                  reference
                    "RFC 5848: Signed Syslog Messages";
    
                  leaf cert-initial-repeat {
                    type uint16;
                    mandatory true;
                    description
                      "This leaf specifies the number of times each 
                     Certificate Block should be sent before the first 
                     message is sent.";
                  }
    
                  leaf cert-resend-delay {
                    type uint16;
                    mandatory true;
                    description
                      "This leaf specifies the maximum time delay in 
                     seconds until resending the Certificate Block.";
                  }
    
                  leaf cert-resend-count {
                    type uint16;
                    mandatory true;
                    description
                      "This leaf specifies the maximum number of other 
                     syslog messages to send until resending the 
                     Certificate Block.";
                  }
    
                  leaf sig-max-delay {
                    type uint16;
                    mandatory true;
                    description
                      "This leaf specifies when to generate a new 
                     Signature Block. If this many seconds have 
                     elapsed since the message with the first message 
                     number of the Signature Block was sent, a new 
                     Signature Block should be generated.";
                  }
    
                  leaf sig-number-resends {
                    type uint16;
                    mandatory true;
                    description
                      "This leaf specifies the number of times a 
                     Signature Block is resent. (It is recommended to 
                     select a value of greater than 0 in particular 
                     when the UDP transport [RFC5426] is used.).";
                  }
    
                  leaf sig-resend-delay {
                    type uint16;
                    mandatory true;
                    description
                      "This leaf specifies when to send the next 
                     Signature Block transmission based on time. If 
                     this many seconds have elapsed since the previous 
                     sending of this Signature Block, resend it.";
                  }
    
                  leaf sig-resend-count {
                    type uint16;
                    mandatory true;
                    description
                      "This leaf specifies when to send the next 
                     Signature Block transmission based on a count. 
                     If this many other syslog messages have been sent 
                     since the previous sending of this Signature 
                     Block, resend it.";
                  }
                }  // container syslog-sign
              }  // list destination
            }  // container remote
    
            container session {
              description
                "This container describes the configuration parameters for
               user CLI session logging configuration.";
              container all-users {
                presence
                  "Enables logging to all user sessions.";
                description
                  "This container describes the configuration
                 parameters for all users.";
                uses selector;
              }  // container all-users
    
              list user {
                key "name";
                description
                  "This list describes a collection of user names.";
                leaf name {
                  type string;
                  description
                    "This leaf uniquely describes a user name which
                   is the login name of the user whose session
                   is to receive log messages.";
                }
    
                uses selector;
              }  // list user
            }  // container session
          }  // container actions
        }  // container syslog
      }  // module ietf-syslog
    

© 2023 YumaWorks, Inc. All rights reserved.