|
| 1 | +# Extra set of common parsers |
| 2 | +# |
| 3 | + |
| 4 | +parsers: |
| 5 | + - name: crowbar |
| 6 | + # https://rubular.com/r/cCVd1HLCAO |
| 7 | + format: regex |
| 8 | + regex: '^.*\[(?<log_time>[^ ][-.\d\+:]+T[:\d]*)([^\]])*?\]\s+?(?<severity>[^ ]\w+)([\s-]*):?\s+(?<message>.*)' |
| 9 | + time_format: '%Y-%m-%dT%H:%M:%S' |
| 10 | + time_keep: Off |
| 11 | + time_key: log_time |
| 12 | + |
| 13 | + - name: chefclient |
| 14 | + # https://rubular.com/r/frDgnElXW9 |
| 15 | + format: regex |
| 16 | + regex: '^\[(?<log_time>[^ ][-.\d\+:]+T[:\d]*)([^\]])*?\]\s+(?<severity>[^ ]\w+):\s+(?<message>.*)$' |
| 17 | + time_format: '%Y-%m-%dT%H:%M:%S' |
| 18 | + time_keep: Off |
| 19 | + time_key: log_time |
| 20 | + |
| 21 | + - name: mysql_error |
| 22 | + format: regex |
| 23 | + #regex: '^(?<log_time>[^ +][ -:0-9TZ]+|[[:upper:]][[:lower:]]{2})(\+\d+:\d+[TZ]*){0,1}\s*(?<myid>[^ ]\d+)\s+\[(?<severity>[^ ]\w+)\](\s+(?<subsystem>[^ ]\w+):){0,1}\s+(?<message>.*)$' |
| 24 | + regex: '^(?<log_time>[^ +][-\d]+[\ T]*[:\dZ]+)\s*(?<myid>[^ ]\d+)\s+\[(?<severity>[^ ]\w+)\](\s+(?<subsystem>[^ ]\w+):){0,1}\s+(?<message>.*)$' |
| 25 | + time_format: '%Y-%m-%d %H:%M:%S' |
| 26 | + time_keep: Off |
| 27 | + time_key: log_time |
| 28 | + |
| 29 | + - name: mysql_slow |
| 30 | + format: regex |
| 31 | + regex: '^# User\@Host:\s+(?<user>[^\@][\w\[\]]+)[@\s]+(?<dbhost>[^ ][-.\w]+)\s+(\[(?<dbhost_address>[.\d]+)\]){0,1}\s+(?<message>.*)$' |
| 32 | + |
| 33 | + - name: pacemaker |
| 34 | + format: regex |
| 35 | + regex: '^\s*(?<log_time>[^ ]* {1,2}[^ ]* [^ ]*) \[(?<pid>\d+)\] (?<node>[\-\w]*)\s*(?<component>\w*):\s+(?<severity>\w+):\s+(?<message>.*)$' |
| 36 | + #time_format: '%Y-%m-%dT%H:%M:%S' |
| 37 | + time_format: '%b %d %H:%M:%S' |
| 38 | + time_keep: Off |
| 39 | + time_key: log_time |
| 40 | + #types: 'pid:integer' |
| 41 | + # |
| 42 | + |
| 43 | + - name: rabbitmq |
| 44 | + format: regex |
| 45 | + regex: '^=(?<severity>[^ ]\w+)\s+REPORT[=\s]*(?<log_time>[^ =][-:.\d\w]+)[\s=]+(?<message>.*)$' |
| 46 | + time_format: '%d-%b-%Y::%H:%M:%S' |
| 47 | + time_keep: Off |
| 48 | + time_key: log_time |
| 49 | + |
| 50 | + - name: http_statement |
| 51 | + format: regex |
| 52 | + regex: '^.*((?<req_method>GET|POST|PUT|DELETE|CONNECT|OPTIONS|HEAD[^ ]\w+)\s*(?<req_path>[^ ][-._?=%&\/[:alnum:]]*)\s*(?<req_protocol>[^ ][.\/\dHTFSP]+){0,1})([''"\s]*){0,1}((\s*status:\s*(?<req_status>[^ ]\d+)){0,1}(\s*len:\ (?<req_len>[^ ]\d+)){0,1}(\s*time:\s*(?<req_log_time>[^ ][.\d]+)){0,1}(\s*microversion:\s*(?<req_mver>[^ ][.\d]+)){0,1}){0,1}$' |
| 53 | + |
| 54 | + - name: universal |
| 55 | + format: regex |
| 56 | + regex: ^(?<message>.*)$ |
| 57 | + |
| 58 | + - name: uuid |
| 59 | + format: regex |
| 60 | + regex: (?<uuid>[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}) |
| 61 | + #UUID v1 : |
| 62 | + #/^[0-9A-F]{8}-[0-9A-F]{4}-[1][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i |
| 63 | + #UUID v2 : |
| 64 | + #/^[0-9A-F]{8}-[0-9A-F]{4}-[2][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i |
| 65 | + #UUID v3 : |
| 66 | + #/^[0-9A-F]{8}-[0-9A-F]{4}-[3][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i |
| 67 | + #UUID v4 : |
| 68 | + #/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i |
| 69 | + #UUID v5 : |
| 70 | + #/^[0-9A-F]{8}-[0-9A-F]{4}-[5][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i |
| 71 | + # |
| 72 | + # Parse IP Tables rules - this one regex should capture pretty much any IP Tables rule and split it into the various fields |
| 73 | + |
| 74 | + - name: iptables |
| 75 | + format: regex |
| 76 | + regex: '\[(?<rule_chain>\w*)-(?<rule_name>\w*)-(?<accept_or_drop>\w*)\]IN=(?<in_interface>[\w.]+)? OUT=(?<out_interface>[\w.]+)? MAC=(?<mac_address>[\w:]+)? SRC=(?<source>(?:[0-9]{1,3}\.){3}[0-9]{1,3}) DST=(?<dest>(?:[0-9]{1,3}\.){3}[0-9]{1,3}) LEN=(?<pkt_len>\d+) TOS=(?<pkt_tos>[\w\d]+) PREC=(?<pkt_prec>[\w\d]+) TTL=(?<pkt_ttl>\d+) ID=(?<pkt_id>\d+)\s?(?<pkg_frg>[A-Z\s].?)\s?PROTO=(?<protocol>[\w\d]+) (SPT=(?<source_port>.*) DPT=(?<dest_port>.*) (LEN=(?<proto_pkt_len>\w+)?)?(WINDOW=(?<proto_window_size>\d+) RES=(?<pkt_res>\w+)? (?<pkt_type>\w+)\s((?<pkt_flag>\w+)?)\s?URGP=(?<pkg_urgency>\d))? )?(TYPE=(?<pkt_icmp_type>\d+) CODE=(?<pkt_icmp_code>\d+) ID=(?<pkt_icmp_id>\d+) SEQ=(?<pkt_icmp_seq>\d+) )?$' |
| 77 | + types: 'source_port:integer,dest_port:integer,pkt_ttl:integer,pkt_tos:integer,pkt_len:integer' |
| 78 | + |
| 79 | + - name: couchbase_json_log_nanoseconds |
| 80 | + # Various parsers for Couchbase Server logs |
| 81 | + # |
| 82 | + format: json |
| 83 | + time_key: timestamp |
| 84 | + time_format: '%Y-%m-%dT%H:%M:%S.%L' |
| 85 | + time_keep: On |
| 86 | + # Do not remove the time field from the output we ship |
| 87 | + # |
| 88 | + |
| 89 | + - name: couchbase_rebalance_report |
| 90 | + format: json |
| 91 | + time_key: timestamp |
| 92 | + time_format: '%Y-%m-%dT%H:%M:%SZ' |
| 93 | + time_keep: On |
| 94 | + |
| 95 | + - name: couchbase_simple_log |
| 96 | + # The level may have optional brackets around it |
| 97 | + format: regex |
| 98 | + regex: '^(?<timestamp>\d+-\d+-\d+T\d+:\d+:\d+\.\d+(\+|-)\d+:\d+)\s+\[(?<level>\w+)\](?<message>.*)$' |
| 99 | + time_key: timestamp |
| 100 | + time_format: '%Y-%m-%dT%H:%M:%S.%L%z' |
| 101 | + time_keep: On |
| 102 | + |
| 103 | + - name: couchbase_simple_log_space_separated |
| 104 | + format: regex |
| 105 | + regex: '^(?<timestamp>\d+-\d+-\d+T\d+:\d+:\d+\.\d+(\+|-)\d+:\d+)\s+(?<level>\w+)\s+(?<message>.*)$' |
| 106 | + time_key: timestamp |
| 107 | + time_format: '%Y-%m-%dT%H:%M:%S.%L%z' |
| 108 | + time_keep: On |
| 109 | + |
| 110 | + - name: couchbase_simple_log_utc |
| 111 | + # Slight change in time format to use Z at end instead of offset: |
| 112 | + # 2021-03-09T17:32:02.136Z INFO ... |
| 113 | + # https://rubular.com/r/EpG3M1dHb5AnTC |
| 114 | + format: regex |
| 115 | + regex: '^(?<timestamp>\d+-\d+-\d+T\d+:\d+:\d+\.\d+Z)\s+(?<level>\w+)(?<message>.*)$' |
| 116 | + time_key: timestamp |
| 117 | + time_format: '%Y-%m-%dT%H:%M:%S.%LZ' |
| 118 | + time_keep: On |
| 119 | + |
| 120 | + - name: couchbase_simple_log_mixed |
| 121 | + # Cope with two different log formats, e.g.: |
| 122 | + # 2021/03/09 17:32:15 cbauth: ... |
| 123 | + # 2021-03-09T17:32:15.303+00:00 [INFO] ... |
| 124 | + # https://rubular.com/r/XUt7xQqEJnrF2M |
| 125 | + format: regex |
| 126 | + regex: '^(?<timestamp>\d+(-|/)\d+(-|/)\d+(T|\s+)\d+:\d+:\d+(\.\d+(\+|-)\d+:\d+|))\s+((\[)?(?<level>\w+)(\]|:))(?<message>.*)$' |
| 127 | + time_key: timestamp |
| 128 | + time_keep: On |
| 129 | + # We cannot parse the time as different formats directly, it could be done downstream and/or left as current time |
| 130 | + # |
| 131 | + |
| 132 | + - name: couchbase_erlang_multiline |
| 133 | + format: regex |
| 134 | + # For some reason this cannot parse an ending close bracket ] followed by a new line immediately |
| 135 | + #regex: '\[(?<logger>\w+):(?<level>\w+),(?<timestamp>\d+-\d+-\d+T\d+:\d+:\d+.\d+Z),.*\](?<message>.*)$' |
| 136 | + regex: '\[(?<logger>\w+):(?<level>\w+),(?<timestamp>\d+-\d+-\d+T\d+:\d+:\d+.\d+Z),(?<message>.*)$' |
| 137 | + time_key: timestamp |
| 138 | + time_format: '%Y-%m-%dT%H:%M:%S.%L' |
| 139 | + time_keep: On |
| 140 | + |
| 141 | + - name: couchbase_java_multiline |
| 142 | + # 2021-03-09T17:32:25.339+00:00 INFO CBAS.bootstrap.AnalyticsNCApplication [main] ... |
| 143 | + # https://rubular.com/r/9jh1oKtXBN5GEV |
| 144 | + # Can include an exception stack trace or a thread dump as well but ignoring these for now |
| 145 | + format: regex |
| 146 | + regex: '^(?<timestamp>\d+-\d+-\d+T\d+:\d+:\d+\.\d+(\+|-)\d+:\d+)\s+(?<level>\w+)\s+(?<class>.*)\s+\[(?<thread>.*)\]\s+(?<message>.*)$' |
| 147 | + time_key: timestamp |
| 148 | + time_format: '%Y-%m-%dT%H:%M:%S.%L%z' |
| 149 | + time_keep: On |
| 150 | + |
| 151 | + - name: couchbase_http |
| 152 | + # A slight modification of the usual Apache/Apache2 parsers |
| 153 | + format: regex |
| 154 | + regex: '^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<timestamp>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*) - (?<client>.*)$' |
| 155 | + time_key: timestamp |
| 156 | + time_format: '%d/%b/%Y:%H:%M:%S %z' |
| 157 | + time_keep: On |
| 158 | + |
| 159 | +# End of Couchbase Server parsers |
0 commit comments