HEX
Server: Apache
System: Linux sg241.singhost.net 2.6.32-896.16.1.lve1.4.51.el6.x86_64 #1 SMP Wed Jan 17 13:19:23 EST 2018 x86_64
User: honghock (909)
PHP: 8.0.30
Disabled: passthru,system,shell_exec,show_source,exec,popen,proc_open
Upload Files
File: //opt/osquery/share/osquery/lenses/rancid.aug
(*
Module: Rancid
  Parses RANCiD router database

Author: Matt Dainty <matt@bodgit-n-scarper.com>

About: Reference
       - man 5 router.db

Each line represents a record consisting of a number of ';'-separated fields
the first of which is the IP/Hostname of the device, followed by the type, its
state and optionally a comment.

*)

module Rancid =
  autoload xfm

  let sep     = Util.del_str ";"
  let field   = /[^;#\n]+/
  let comment = [ label "comment" . store /[^;#\n]*/ ]
  let eol     = Util.del_str "\n"
  let record  = [ label "device" . store field . sep . [ label "type" . store field ] . sep . [ label "state" . store field ] . ( sep . comment )? . eol ]

  let lns = ( Util.empty | Util.comment_generic /#[ \t]*/ "# " | record )*

  let filter = incl "/var/rancid/*/router.db"
             . Util.stdexcl

  let xfm = transform lns filter

(* Local Variables: *)
(* mode: caml       *)
(* End:             *)