├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── actions.go ├── actions_test.go ├── dyn_stat.go ├── dyn_stat_test.go ├── exporter.go ├── exporter_test.go ├── fixtures └── rsyslog-stats.log ├── inputs.go ├── inputs_test.go ├── main.go ├── point.go ├── point_test.go ├── pointstore.go ├── pointstore_test.go ├── queues.go ├── queues_test.go ├── resources.go ├── resources_test.go └── utils.go /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files, Static and Dynamic libs (Shared Objects) 2 | *.o 3 | *.a 4 | *.so 5 | 6 | # Folders 7 | _obj 8 | _test 9 | 10 | # Architecture specific extensions/prefixes 11 | *.[568vq] 12 | [568vq].out 13 | 14 | *.cgo1.go 15 | *.cgo2.c 16 | _cgo_defun.c 17 | _cgo_gotypes.go 18 | _cgo_export.* 19 | 20 | _testmain.go 21 | 22 | *.exe 23 | *.test 24 | *.prof 25 | rsyslog_exporter 26 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | 3 | go: 4 | - 1.4 5 | 6 | install: 7 | - go get github.com/digitalocean/rsyslog_exporter 8 | 9 | script: 10 | - make test 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # *** Unsupported Fork *** 2 | 3 | The changes in this fork were made for internal use at SoundCloud. 4 | They are available here in the hope that they are useful to someone, but we cannot maintain this fork as an ongoing project. 5 | 6 | Please submit PRs against [the prometheus-community project](https://github.com/prometheus-community/rsyslog_exporter) instead. 7 | 8 | # rsyslog_exporter [![Build Status](https://travis-ci.org/digitalocean/rsyslog_exporter.svg?branch=master)](https://travis-ci.org/digitalocean/rsyslog_exporter) 9 | 10 | A [prometheus](http://prometheus.io/) exporter for [rsyslog](http://rsyslog.com). It accepts rsyslog [impstats](http://www.rsyslog.com/doc/master/configuration/modules/impstats.html) metrics in JSON format over stdin via the rsyslog [omprog](http://www.rsyslog.com/doc/v8-stable/configuration/modules/omprog.html) plugin and transforms and exposes them for consumption by Prometheus. 11 | 12 | ## Rsyslog Configuration 13 | Configure rsyslog to push JSON formatted stats via omprog: 14 | ``` 15 | module( 16 | load="impstats" 17 | interval="10" 18 | format="json" 19 | resetCounters="off" 20 | ruleset="process_stats" 21 | ) 22 | 23 | ruleset(name="process_stats") { 24 | action( 25 | type="omprog" 26 | name="to_exporter" 27 | binary="/usr/local/bin/rsyslog_exporter" 28 | ) 29 | } 30 | ``` 31 | 32 | The exporter itself logs back via syslog, this cannot be configured at the moment. 33 | 34 | ## Provided Metrics 35 | The following metrics provided by the rsyslog impstats module are tracked by rsyslog_exporter: 36 | 37 | ### Actions 38 | Action objects describe what is to be done with a message, and are implemented via output modules. 39 | For each action object, the following metrics are provided: 40 | 41 | * processed - messages processed by this action 42 | * failed - number of messages this action failed to process 43 | * suspended - number of times this action was suspended 44 | * suspended_duration - amount of time this action has spent in a suspended state 45 | * resumed - number of times this action has resumed from a suspended state 46 | 47 | ### Inputs 48 | Input objects describe message input sources. 49 | For each input object, the following metrics are provided: 50 | 51 | * submitted - messages submitted to this input 52 | 53 | ### Queues 54 | Queues in rsyslog are used for the main message queue and for actions. Additionally, each ruleset 55 | in an rsyslog configuration may optionally have its own separate main queue. For each queue, 56 | the following metrics are provided: 57 | 58 | * size - messages currently in queue 59 | * enqueued - total messages enqueued during lifetime of queue 60 | * full - number of times the queue was full 61 | * discarded_full - number of times messages were discarded due to the queue being full 62 | * discarded_not_full - number of times messages discarded but queue was not full 63 | * max_queue_size - maximum size the queue reached during its lifetime 64 | 65 | ### Resources 66 | Rsyslog tracks how it uses system resources and provides the following metrics: 67 | 68 | * utime - user time used in microseconds 69 | * stime - system time used in microseconds 70 | * maxrss - maximum resident set size 71 | * minflt - total number of minor faults 72 | * majflt - total number of major faults 73 | * inblock - number of filesystem input operations 74 | * oublock - number of filesystem output operations 75 | * nvcsw - number of voluntary context switches 76 | * nivcsw - number of involuntary context switches 77 | 78 | 79 | -------------------------------------------------------------------------------- /actions.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type action struct { 9 | Name string `json:"name"` 10 | Processed int64 `json:"processed"` 11 | Failed int64 `json:"failed"` 12 | Suspended int64 `json:"suspended"` 13 | SuspendedDuration int64 `json:"suspended.duration"` 14 | Resumed int64 `json:"resumed"` 15 | } 16 | 17 | func newActionFromJSON(b []byte) (*action, error) { 18 | var pstat action 19 | err := json.Unmarshal(b, &pstat) 20 | if err != nil { 21 | return nil, fmt.Errorf("failed to decode action stat `%v`: %v", string(b), err) 22 | } 23 | return &pstat, nil 24 | } 25 | 26 | func (a *action) toPoints() []*point { 27 | points := make([]*point, 5) 28 | 29 | points[0] = &point{ 30 | Name: "action_processed", 31 | Type: counter, 32 | Value: a.Processed, 33 | Description: "messages processed", 34 | LabelName: "action", 35 | LabelValue: a.Name, 36 | } 37 | 38 | points[1] = &point{ 39 | Name: "action_failed", 40 | Type: counter, 41 | Value: a.Failed, 42 | Description: "messages failed", 43 | LabelName: "action", 44 | LabelValue: a.Name, 45 | } 46 | 47 | points[2] = &point{ 48 | Name: "action_suspended", 49 | Type: counter, 50 | Value: a.Suspended, 51 | Description: "times suspended", 52 | LabelName: "action", 53 | LabelValue: a.Name, 54 | } 55 | 56 | points[3] = &point{ 57 | Name: "action_suspended_duration", 58 | Type: counter, 59 | Value: a.SuspendedDuration, 60 | Description: "time spent suspended", 61 | LabelName: "action", 62 | LabelValue: a.Name, 63 | } 64 | 65 | points[4] = &point{ 66 | Name: "action_resumed", 67 | Type: counter, 68 | Value: a.Resumed, 69 | Description: "times resumed", 70 | LabelName: "action", 71 | LabelValue: a.Name, 72 | } 73 | 74 | return points 75 | } 76 | -------------------------------------------------------------------------------- /actions_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "testing" 4 | 5 | var ( 6 | actionLog = []byte(`{"name":"test_action","processed":100000,"failed":2,"suspended":1,"suspended.duration":1000,"resumed":1}`) 7 | ) 8 | 9 | func TestNewActionFromJSON(t *testing.T) { 10 | logType := getStatType(actionLog) 11 | if logType != rsyslogAction { 12 | t.Errorf("detected pstat type should be %d but is %d", rsyslogAction, logType) 13 | } 14 | 15 | pstat, err := newActionFromJSON([]byte(actionLog)) 16 | if err != nil { 17 | t.Fatalf("expected parsing action not to fail, got: %v", err) 18 | } 19 | 20 | if want, got := "test_action", pstat.Name; want != got { 21 | t.Errorf("wanted '%s', got '%s'", want, got) 22 | } 23 | 24 | if want, got := int64(100000), pstat.Processed; want != got { 25 | t.Errorf("wanted '%d', got '%d'", want, got) 26 | } 27 | 28 | if want, got := int64(2), pstat.Failed; want != got { 29 | t.Errorf("wanted '%d', got '%d'", want, got) 30 | } 31 | 32 | if want, got := int64(1), pstat.Suspended; want != got { 33 | t.Errorf("wanted '%d', got '%d'", want, got) 34 | } 35 | 36 | if want, got := int64(1000), pstat.SuspendedDuration; want != got { 37 | t.Errorf("wanted '%d', got '%d'", want, got) 38 | } 39 | 40 | if want, got := int64(1), pstat.Resumed; want != got { 41 | t.Errorf("wanted '%d', got '%d'", want, got) 42 | } 43 | } 44 | 45 | func TestActionToPoints(t *testing.T) { 46 | pstat, err := newActionFromJSON([]byte(actionLog)) 47 | if err != nil { 48 | t.Fatalf("expected parsing action not to fail, got: %v", err) 49 | } 50 | points := pstat.toPoints() 51 | 52 | point := points[0] 53 | if want, got := "action_processed", point.Name; want != got { 54 | t.Errorf("wanted '%s', got '%s'", want, got) 55 | } 56 | 57 | if want, got := int64(100000), point.Value; want != got { 58 | t.Errorf("wanted '%d', got '%d'", want, got) 59 | } 60 | 61 | if want, got := counter, point.Type; want != got { 62 | t.Errorf("wanted '%d', got '%d'", want, got) 63 | } 64 | 65 | if want, got := "test_action", point.LabelValue; want != got { 66 | t.Errorf("wanted '%s', got '%s'", want, got) 67 | } 68 | 69 | point = points[1] 70 | if want, got := "action_failed", point.Name; want != got { 71 | t.Errorf("wanted '%s', got '%s'", want, got) 72 | } 73 | 74 | if want, got := int64(2), point.Value; want != got { 75 | t.Errorf("wanted '%d', got '%d'", want, got) 76 | } 77 | 78 | if want, got := counter, point.Type; want != got { 79 | t.Errorf("wanted '%d', got '%d'", want, got) 80 | } 81 | 82 | if want, got := "test_action", point.LabelValue; want != got { 83 | t.Errorf("wanted '%s', got '%s'", want, got) 84 | } 85 | 86 | point = points[2] 87 | if want, got := "action_suspended", point.Name; want != got { 88 | t.Errorf("wanted '%s', got '%s'", want, got) 89 | } 90 | 91 | if want, got := int64(1), point.Value; want != got { 92 | t.Errorf("wanted '%d', got '%d'", want, got) 93 | } 94 | 95 | if want, got := counter, point.Type; want != got { 96 | t.Errorf("wanted '%d', got '%d'", want, got) 97 | } 98 | 99 | if want, got := "test_action", point.LabelValue; want != got { 100 | t.Errorf("wanted '%s', got '%s'", want, got) 101 | } 102 | 103 | point = points[3] 104 | if want, got := "action_suspended_duration", point.Name; want != got { 105 | t.Errorf("wanted '%s', got '%s'", want, got) 106 | } 107 | 108 | if want, got := int64(1000), point.Value; want != got { 109 | t.Errorf("wanted '%d', got '%d'", want, got) 110 | } 111 | 112 | if want, got := counter, point.Type; want != got { 113 | t.Errorf("wanted '%d', got '%d'", want, got) 114 | } 115 | 116 | if want, got := "test_action", point.LabelValue; want != got { 117 | t.Errorf("wanted '%s', got '%s'", want, got) 118 | } 119 | 120 | point = points[4] 121 | if want, got := "action_resumed", point.Name; want != got { 122 | t.Errorf("wanted '%s', got '%s'", want, got) 123 | } 124 | 125 | if want, got := int64(1), point.Value; want != got { 126 | t.Errorf("wanted '%d', got '%d'", want, got) 127 | } 128 | 129 | if want, got := counter, point.Type; want != got { 130 | t.Errorf("wanted '%d', got '%d'", want, got) 131 | } 132 | 133 | if want, got := "test_action", point.LabelValue; want != got { 134 | t.Errorf("wanted '%s', got '%s'", want, got) 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /dyn_stat.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type dynStat struct { 9 | Name string `json:"name"` 10 | Origin string `json:"origin"` 11 | Values map[string]int64 `json:"values"` 12 | } 13 | 14 | func newDynStatFromJSON(b []byte) (*dynStat, error) { 15 | var pstat dynStat 16 | err := json.Unmarshal(b, &pstat) 17 | if err != nil { 18 | return nil, fmt.Errorf("error decoding values stat `%v`: %v", string(b), err) 19 | } 20 | return &pstat, nil 21 | } 22 | 23 | func (i *dynStat) toPoints() []*point { 24 | points := make([]*point, 0, len(i.Values)) 25 | 26 | for name, value := range i.Values { 27 | points = append(points, &point{ 28 | Name: fmt.Sprintf("dynstat_%s", i.Name), 29 | Type: counter, 30 | Value: value, 31 | Description: fmt.Sprintf("dynamic statistic bucket %s", i.Name), 32 | LabelName: "counter", 33 | LabelValue: name, 34 | }) 35 | } 36 | 37 | return points 38 | } 39 | -------------------------------------------------------------------------------- /dyn_stat_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "reflect" 5 | "testing" 6 | ) 7 | 8 | func TestGetDynStat(t *testing.T) { 9 | log := []byte(`{ "name": "global", "origin": "dynstats", "values": { "msg_per_host.ops_overflow": 1, "msg_per_host.new_metric_add": 3, "msg_per_host.no_metric": 0, "msg_per_host.metrics_purged": 0, "msg_per_host.ops_ignored": 0 } }`) 10 | values := map[string]int64{ 11 | "msg_per_host.ops_overflow": 1, 12 | "msg_per_host.new_metric_add": 3, 13 | "msg_per_host.no_metric": 0, 14 | "msg_per_host.metrics_purged": 0, 15 | "msg_per_host.ops_ignored": 0, 16 | } 17 | 18 | if want, got := rsyslogDynStat, getStatType(log); want != got { 19 | t.Errorf("detected pstat type should be %d but is %d", want, got) 20 | } 21 | 22 | pstat, err := newDynStatFromJSON(log) 23 | if err != nil { 24 | t.Fatalf("expected parsing dynamic stat not to fail, got: %v", err) 25 | } 26 | 27 | if want, got := "global", pstat.Name; want != got { 28 | t.Errorf("invalid name, want '%s', got '%s'", want, got) 29 | } 30 | 31 | if want, got := values, pstat.Values; !reflect.DeepEqual(want, got) { 32 | t.Errorf("unexpected values, want: %+v got: %+v", want, got) 33 | } 34 | } 35 | 36 | func TestDynStatToPoints(t *testing.T) { 37 | log := []byte(`{ "name": "global", "origin": "dynstats", "values": { "msg_per_host.ops_overflow": 1, "msg_per_host.new_metric_add": 3, "msg_per_host.no_metric": 0, "msg_per_host.metrics_purged": 0, "msg_per_host.ops_ignored": 0 } }`) 38 | wants := map[string]point{ 39 | "msg_per_host.ops_overflow": point{ 40 | Name: "dynstat_global", 41 | Type: counter, 42 | Value: 1, 43 | Description: "dynamic statistic bucket global", 44 | LabelName: "counter", 45 | LabelValue: "msg_per_host.ops_overflow", 46 | }, 47 | "msg_per_host.new_metric_add": point{ 48 | Name: "dynstat_global", 49 | Type: counter, 50 | Value: 3, 51 | Description: "dynamic statistic bucket global", 52 | LabelName: "counter", 53 | LabelValue: "msg_per_host.new_metric_add", 54 | }, 55 | "msg_per_host.no_metric": point{ 56 | Name: "dynstat_global", 57 | Type: counter, 58 | Value: 0, 59 | Description: "dynamic statistic bucket global", 60 | LabelName: "counter", 61 | LabelValue: "msg_per_host.no_metric", 62 | }, 63 | "msg_per_host.metrics_purged": point{ 64 | Name: "dynstat_global", 65 | Type: counter, 66 | Value: 0, 67 | Description: "dynamic statistic bucket global", 68 | LabelName: "counter", 69 | LabelValue: "msg_per_host.metrics_purged", 70 | }, 71 | "msg_per_host.ops_ignored": point{ 72 | Name: "dynstat_global", 73 | Type: counter, 74 | Value: 0, 75 | Description: "dynamic statistic bucket global", 76 | LabelName: "counter", 77 | LabelValue: "msg_per_host.ops_ignored", 78 | }, 79 | } 80 | 81 | seen := map[string]bool{} 82 | for name, _ := range wants { 83 | seen[name] = false 84 | } 85 | 86 | pstat, err := newDynStatFromJSON(log) 87 | if err != nil { 88 | t.Fatalf("expected parsing dyn stat not to fail, got: %v", err) 89 | } 90 | 91 | points := pstat.toPoints() 92 | for _, got := range points { 93 | key := got.LabelValue 94 | want, ok := wants[key] 95 | if !ok { 96 | t.Errorf("unexpected point, got: %+v", got) 97 | continue 98 | } 99 | 100 | if !reflect.DeepEqual(want, *got) { 101 | t.Errorf("expected point to be %+v, got %+v", want, got) 102 | } 103 | 104 | if seen[key] { 105 | t.Errorf("point seen multiple times: %+v", got) 106 | } 107 | seen[key] = true 108 | } 109 | 110 | for name, ok := range seen { 111 | if !ok { 112 | t.Errorf("expected to see point with key %s, but did not", name) 113 | } 114 | } 115 | } 116 | -------------------------------------------------------------------------------- /exporter.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "bufio" 5 | "bytes" 6 | "fmt" 7 | "log" 8 | "os" 9 | "sync" 10 | 11 | "github.com/prometheus/client_golang/prometheus" 12 | ) 13 | 14 | type rsyslogType int 15 | 16 | const ( 17 | rsyslogUnknown rsyslogType = iota 18 | rsyslogAction 19 | rsyslogInput 20 | rsyslogQueue 21 | rsyslogResource 22 | rsyslogDynStat 23 | ) 24 | 25 | type rsyslogExporter struct { 26 | started bool 27 | logfile *os.File 28 | scanner *bufio.Scanner 29 | pointStore 30 | } 31 | 32 | func newRsyslogExporter() *rsyslogExporter { 33 | e := &rsyslogExporter{ 34 | scanner: bufio.NewScanner(os.Stdin), 35 | pointStore: pointStore{ 36 | pointMap: make(map[string]*point), 37 | lock: &sync.RWMutex{}, 38 | }, 39 | } 40 | return e 41 | } 42 | 43 | func (re *rsyslogExporter) handleStatLine(rawbuf []byte) error { 44 | s := bytes.SplitN(rawbuf, []byte(" "), 4) 45 | if len(s) != 4 { 46 | return fmt.Errorf("failed to split log line, expected 4 columns, got: %v", len(s)) 47 | } 48 | buf := s[3] 49 | 50 | pstatType := getStatType(buf) 51 | 52 | switch pstatType { 53 | case rsyslogAction: 54 | a, err := newActionFromJSON(buf) 55 | if err != nil { 56 | return err 57 | } 58 | for _, p := range a.toPoints() { 59 | re.set(p) 60 | } 61 | 62 | case rsyslogInput: 63 | i, err := newInputFromJSON(buf) 64 | if err != nil { 65 | return err 66 | } 67 | for _, p := range i.toPoints() { 68 | re.set(p) 69 | } 70 | 71 | case rsyslogQueue: 72 | q, err := newQueueFromJSON(buf) 73 | if err != nil { 74 | return err 75 | } 76 | for _, p := range q.toPoints() { 77 | re.set(p) 78 | } 79 | 80 | case rsyslogResource: 81 | r, err := newResourceFromJSON(buf) 82 | if err != nil { 83 | return err 84 | } 85 | for _, p := range r.toPoints() { 86 | re.set(p) 87 | } 88 | case rsyslogDynStat: 89 | s, err := newDynStatFromJSON(buf) 90 | if err != nil { 91 | return err 92 | } 93 | for _, p := range s.toPoints() { 94 | re.set(p) 95 | } 96 | 97 | default: 98 | return fmt.Errorf("unknown pstat type: %v", pstatType) 99 | } 100 | return nil 101 | } 102 | 103 | // Describe sends the description of currently known metrics collected 104 | // by this Collector to the provided channel. Note that this implementation 105 | // does not necessarily send the "super-set of all possible descriptors" as 106 | // defined by the Collector interface spec, depending on the timing of when 107 | // it is called. The rsyslog exporter does not know all possible metrics 108 | // it will export until the first full batch of rsyslog impstats messages 109 | // are received via stdin. This is ok for now. 110 | func (re *rsyslogExporter) Describe(ch chan<- *prometheus.Desc) { 111 | ch <- prometheus.NewDesc( 112 | prometheus.BuildFQName("", "rsyslog", "scrapes"), 113 | "times exporter has been scraped", 114 | nil, nil, 115 | ) 116 | 117 | keys := re.keys() 118 | 119 | for _, k := range keys { 120 | p, err := re.get(k) 121 | if err != nil { 122 | ch <- p.promDescription() 123 | } 124 | } 125 | } 126 | 127 | // Collect is called by Prometheus when collecting metrics. 128 | func (re *rsyslogExporter) Collect(ch chan<- prometheus.Metric) { 129 | keys := re.keys() 130 | 131 | for _, k := range keys { 132 | p, err := re.get(k) 133 | if err != nil { 134 | continue 135 | } 136 | 137 | metric := prometheus.MustNewConstMetric( 138 | p.promDescription(), 139 | p.promType(), 140 | p.promValue(), 141 | p.promLabelValue(), 142 | ) 143 | 144 | ch <- metric 145 | } 146 | } 147 | 148 | func (re *rsyslogExporter) run() { 149 | for re.scanner.Scan() { 150 | err := re.handleStatLine(re.scanner.Bytes()) 151 | if err != nil { 152 | log.Printf("error handling stats line: %v, line was: %s", err, re.scanner.Bytes()) 153 | } 154 | } 155 | if err := re.scanner.Err(); err != nil { 156 | log.Printf("error reading input: %v", err) 157 | } 158 | log.Print("input ended, exiting normally") 159 | os.Exit(0) 160 | } 161 | -------------------------------------------------------------------------------- /exporter_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "testing" 6 | ) 7 | 8 | func testHelper(t *testing.T, line []byte, testCase []*testUnit) { 9 | exporter := newRsyslogExporter() 10 | exporter.handleStatLine(line) 11 | 12 | for _, k := range exporter.keys() { 13 | t.Logf("have key: '%s'", k) 14 | } 15 | 16 | for _, item := range testCase { 17 | p, err := exporter.get(item.key()) 18 | if err != nil { 19 | t.Error(err) 20 | } 21 | 22 | if want, got := item.Val, p.promValue(); want != got { 23 | t.Errorf("%s: want '%f', got '%f'", item.Name, want, got) 24 | } 25 | } 26 | 27 | exporter.handleStatLine(line) 28 | 29 | for _, item := range testCase { 30 | p, err := exporter.get(item.key()) 31 | if err != nil { 32 | t.Error(err) 33 | } 34 | 35 | var wanted float64 36 | switch p.Type { 37 | case counter: 38 | wanted = item.Val 39 | case gauge: 40 | wanted = item.Val 41 | default: 42 | t.Errorf("%d is not a valid metric type", p.Type) 43 | continue 44 | } 45 | 46 | if want, got := wanted, p.promValue(); want != got { 47 | t.Errorf("%s: want '%f', got '%f'", item.Name, want, got) 48 | } 49 | } 50 | } 51 | 52 | type testUnit struct { 53 | Name string 54 | Val float64 55 | LabelValue string 56 | } 57 | 58 | func (t *testUnit) key() string { 59 | return fmt.Sprintf("%s.%s", t.Name, t.LabelValue) 60 | } 61 | 62 | func TestHandleLineWithAction(t *testing.T) { 63 | tests := []*testUnit{ 64 | &testUnit{ 65 | Name: "action_processed", 66 | Val: 100000, 67 | LabelValue: "test_action", 68 | }, 69 | &testUnit{ 70 | Name: "action_failed", 71 | Val: 2, 72 | LabelValue: "test_action", 73 | }, 74 | &testUnit{ 75 | Name: "action_suspended", 76 | Val: 1, 77 | LabelValue: "test_action", 78 | }, 79 | &testUnit{ 80 | Name: "action_suspended_duration", 81 | Val: 1000, 82 | LabelValue: "test_action", 83 | }, 84 | &testUnit{ 85 | Name: "action_resumed", 86 | Val: 1, 87 | LabelValue: "test_action", 88 | }, 89 | } 90 | 91 | actionLog := []byte(`2017-08-30T08:10:04.786350+00:00 some-node.example.org rsyslogd-pstats: {"name":"test_action","processed":100000,"failed":2,"suspended":1,"suspended.duration":1000,"resumed":1}`) 92 | testHelper(t, actionLog, tests) 93 | } 94 | 95 | func TestHandleLineWithResource(t *testing.T) { 96 | tests := []*testUnit{ 97 | &testUnit{ 98 | Name: "resource_utime", 99 | Val: 10, 100 | LabelValue: "resource-usage", 101 | }, 102 | &testUnit{ 103 | Name: "resource_stime", 104 | Val: 20, 105 | LabelValue: "resource-usage", 106 | }, 107 | &testUnit{ 108 | Name: "resource_maxrss", 109 | Val: 30, 110 | LabelValue: "resource-usage", 111 | }, 112 | &testUnit{ 113 | Name: "resource_minflt", 114 | Val: 40, 115 | LabelValue: "resource-usage", 116 | }, 117 | &testUnit{ 118 | Name: "resource_majflt", 119 | Val: 50, 120 | LabelValue: "resource-usage", 121 | }, 122 | &testUnit{ 123 | Name: "resource_inblock", 124 | Val: 60, 125 | LabelValue: "resource-usage", 126 | }, 127 | &testUnit{ 128 | Name: "resource_oublock", 129 | Val: 70, 130 | LabelValue: "resource-usage", 131 | }, 132 | &testUnit{ 133 | Name: "resource_nvcsw", 134 | Val: 80, 135 | LabelValue: "resource-usage", 136 | }, 137 | &testUnit{ 138 | Name: "resource_nivcsw", 139 | Val: 90, 140 | LabelValue: "resource-usage", 141 | }, 142 | } 143 | 144 | resourceLog := []byte(`2017-08-30T08:10:04.786350+00:00 some-node.example.org rsyslogd-pstats: {"name":"resource-usage","utime":10,"stime":20,"maxrss":30,"minflt":40,"majflt":50,"inblock":60,"oublock":70,"nvcsw":80,"nivcsw":90}`) 145 | testHelper(t, resourceLog, tests) 146 | } 147 | 148 | func TestHandleLineWithInput(t *testing.T) { 149 | tests := []*testUnit{ 150 | &testUnit{ 151 | Name: "input_submitted", 152 | Val: 1000, 153 | LabelValue: "test_input", 154 | }, 155 | } 156 | 157 | inputLog := []byte(`2017-08-30T08:10:04.786350+00:00 some-node.example.org rsyslogd-pstats: {"name":"test_input", "origin":"imuxsock", "submitted":1000}`) 158 | testHelper(t, inputLog, tests) 159 | } 160 | 161 | func TestHandleLineWithQueue(t *testing.T) { 162 | tests := []*testUnit{ 163 | &testUnit{ 164 | Name: "queue_size", 165 | Val: 10, 166 | LabelValue: "main Q", 167 | }, 168 | &testUnit{ 169 | Name: "queue_enqueued", 170 | Val: 20, 171 | LabelValue: "main Q", 172 | }, 173 | &testUnit{ 174 | Name: "queue_full", 175 | Val: 30, 176 | LabelValue: "main Q", 177 | }, 178 | &testUnit{ 179 | Name: "queue_discarded_full", 180 | Val: 40, 181 | LabelValue: "main Q", 182 | }, 183 | &testUnit{ 184 | Name: "queue_discarded_not_full", 185 | Val: 50, 186 | LabelValue: "main Q", 187 | }, 188 | &testUnit{ 189 | Name: "queue_max_size", 190 | Val: 60, 191 | LabelValue: "main Q", 192 | }, 193 | } 194 | 195 | queueLog := []byte(`2017-08-30T08:10:04.786350+00:00 some-node.example.org rsyslogd-pstats: {"name":"main Q","size":10,"enqueued":20,"full":30,"discarded.full":40,"discarded.nf":50,"maxqsize":60}`) 196 | testHelper(t, queueLog, tests) 197 | } 198 | 199 | func TestHandleLineWithGlobal(t *testing.T) { 200 | tests := []*testUnit{ 201 | &testUnit{ 202 | Name: "dynstat_global", 203 | Val: 1, 204 | LabelValue: "msg_per_host.ops_overflow", 205 | }, 206 | &testUnit{ 207 | Name: "dynstat_global", 208 | Val: 3, 209 | LabelValue: "msg_per_host.new_metric_add", 210 | }, 211 | &testUnit{ 212 | Name: "dynstat_global", 213 | Val: 0, 214 | LabelValue: "msg_per_host.no_metric", 215 | }, 216 | &testUnit{ 217 | Name: "dynstat_global", 218 | Val: 0, 219 | LabelValue: "msg_per_host.metrics_purged", 220 | }, 221 | &testUnit{ 222 | Name: "dynstat_global", 223 | Val: 0, 224 | LabelValue: "msg_per_host.ops_ignored", 225 | }, 226 | } 227 | 228 | log := []byte(`2018-01-18T09:39:12.763025+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { "msg_per_host.ops_overflow": 1, "msg_per_host.new_metric_add": 3, "msg_per_host.no_metric": 0, "msg_per_host.metrics_purged": 0, "msg_per_host.ops_ignored": 0 } }`) 229 | 230 | testHelper(t, log, tests) 231 | } 232 | 233 | func TestHandleUnknown(t *testing.T) { 234 | unknownLog := []byte(`2017-08-30T08:10:04.786350+00:00 some-node.example.org rsyslogd-pstats: {"a":"b"}`) 235 | 236 | exporter := newRsyslogExporter() 237 | exporter.handleStatLine(unknownLog) 238 | 239 | if want, got := 0, len(exporter.keys()); want != got { 240 | t.Errorf("want '%d', got '%d'", want, got) 241 | } 242 | } 243 | -------------------------------------------------------------------------------- /fixtures/rsyslog-stats.log: -------------------------------------------------------------------------------- 1 | 2017-08-30T08:09:54.776051+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 2 | 2017-08-30T08:09:54.776072+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 9, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 3 | 2017-08-30T08:09:54.776082+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 4 | 2017-08-30T08:09:54.776088+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 5 | 2017-08-30T08:09:54.776094+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 1, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 6 | 2017-08-30T08:09:54.776098+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 1, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 7 | 2017-08-30T08:09:54.776103+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 8 | 2017-08-30T08:09:54.776109+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 9 | 2017-08-30T08:09:54.776114+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 10 | 2017-08-30T08:09:54.776119+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 11 | 2017-08-30T08:09:54.776123+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 12 | 2017-08-30T08:09:54.776144+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 13 | 2017-08-30T08:09:54.776151+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 14 | 2017-08-30T08:09:54.776155+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 15 | 2017-08-30T08:09:54.776160+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 16 | 2017-08-30T08:09:54.776164+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 17 | 2017-08-30T08:09:54.776173+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 1, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 1045, "bytes.decompressed": 0 } 18 | 2017-08-30T08:09:54.776181+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 5000, "stime": 4000, "maxrss": 5876, "minflt": 521, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 23, "nivcsw": 15, "openfiles": 16 } 19 | 2017-08-30T08:09:54.776187+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 28, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 18 } 20 | 2017-08-30T08:09:54.776191+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 21 | 2017-08-30T08:10:04.786350+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 22 | 2017-08-30T08:10:04.786371+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 12, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 23 | 2017-08-30T08:10:04.786379+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 24 | 2017-08-30T08:10:04.786386+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 20, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 25 | 2017-08-30T08:10:04.786391+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 3, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 26 | 2017-08-30T08:10:04.786395+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 4, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 27 | 2017-08-30T08:10:04.786401+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 28 | 2017-08-30T08:10:04.786407+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 29 | 2017-08-30T08:10:04.786413+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 30 | 2017-08-30T08:10:04.786420+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 31 | 2017-08-30T08:10:04.786425+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 32 | 2017-08-30T08:10:04.786431+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 33 | 2017-08-30T08:10:04.786437+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 34 | 2017-08-30T08:10:04.786443+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 35 | 2017-08-30T08:10:04.786447+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 36 | 2017-08-30T08:10:04.786452+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 37 | 2017-08-30T08:10:04.786459+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 3, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 2920, "bytes.decompressed": 0 } 38 | 2017-08-30T08:10:04.786468+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 6000, "stime": 4000, "maxrss": 5876, "minflt": 591, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 35, "nivcsw": 15, "openfiles": 17 } 39 | 2017-08-30T08:10:04.786475+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 53, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 40 | 2017-08-30T08:10:04.786479+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 41 | 2017-08-30T08:10:14.796202+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 42 | 2017-08-30T08:10:14.796219+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 12, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 43 | 2017-08-30T08:10:14.796227+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 44 | 2017-08-30T08:10:14.796234+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 40, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 45 | 2017-08-30T08:10:14.796239+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 3, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 46 | 2017-08-30T08:10:14.796243+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 4, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 47 | 2017-08-30T08:10:14.796247+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 48 | 2017-08-30T08:10:14.796252+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 49 | 2017-08-30T08:10:14.796258+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 50 | 2017-08-30T08:10:14.796262+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 51 | 2017-08-30T08:10:14.796267+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 52 | 2017-08-30T08:10:14.796271+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 53 | 2017-08-30T08:10:14.796276+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 54 | 2017-08-30T08:10:14.796281+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 55 | 2017-08-30T08:10:14.796285+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 56 | 2017-08-30T08:10:14.796290+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 57 | 2017-08-30T08:10:14.796296+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 3, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 2920, "bytes.decompressed": 0 } 58 | 2017-08-30T08:10:14.796304+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 6000, "stime": 4000, "maxrss": 5876, "minflt": 604, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 37, "nivcsw": 15, "openfiles": 17 } 59 | 2017-08-30T08:10:14.796310+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 73, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 60 | 2017-08-30T08:10:14.796314+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 61 | 2017-08-30T08:10:24.806474+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 62 | 2017-08-30T08:10:24.806492+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 12, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 63 | 2017-08-30T08:10:24.806500+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 64 | 2017-08-30T08:10:24.806506+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 60, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 65 | 2017-08-30T08:10:24.806512+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 3, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 66 | 2017-08-30T08:10:24.806516+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 4, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 67 | 2017-08-30T08:10:24.806521+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 68 | 2017-08-30T08:10:24.806526+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 69 | 2017-08-30T08:10:24.806532+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 70 | 2017-08-30T08:10:24.806536+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 71 | 2017-08-30T08:10:24.806541+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 72 | 2017-08-30T08:10:24.806545+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 73 | 2017-08-30T08:10:24.806551+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 74 | 2017-08-30T08:10:24.806555+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 75 | 2017-08-30T08:10:24.806560+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 76 | 2017-08-30T08:10:24.806564+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 77 | 2017-08-30T08:10:24.806571+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 3, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 2920, "bytes.decompressed": 0 } 78 | 2017-08-30T08:10:24.806580+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 6000, "stime": 4000, "maxrss": 5876, "minflt": 604, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 39, "nivcsw": 15, "openfiles": 17 } 79 | 2017-08-30T08:10:24.806585+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 93, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 80 | 2017-08-30T08:10:24.806590+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 81 | 2017-08-30T08:10:34.812772+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 82 | 2017-08-30T08:10:34.812791+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 33, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 83 | 2017-08-30T08:10:34.812799+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 84 | 2017-08-30T08:10:34.812806+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 80, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 85 | 2017-08-30T08:10:34.812811+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 3, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 86 | 2017-08-30T08:10:34.812816+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 25, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 87 | 2017-08-30T08:10:34.812820+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 88 | 2017-08-30T08:10:34.812826+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 89 | 2017-08-30T08:10:34.812831+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 90 | 2017-08-30T08:10:34.812836+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 91 | 2017-08-30T08:10:34.812840+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 92 | 2017-08-30T08:10:34.812845+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 93 | 2017-08-30T08:10:34.812850+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 94 | 2017-08-30T08:10:34.812855+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 95 | 2017-08-30T08:10:34.812860+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 96 | 2017-08-30T08:10:34.812864+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 97 | 2017-08-30T08:10:34.812871+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 3, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 2920, "bytes.decompressed": 0 } 98 | 2017-08-30T08:10:34.812879+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 6000, "stime": 6000, "maxrss": 5876, "minflt": 605, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 83, "nivcsw": 15, "openfiles": 17 } 99 | 2017-08-30T08:10:34.812885+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 134, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 100 | 2017-08-30T08:10:34.812890+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 101 | 2017-08-30T08:10:44.823040+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 102 | 2017-08-30T08:10:44.823060+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 33, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 103 | 2017-08-30T08:10:44.823067+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 104 | 2017-08-30T08:10:44.823073+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 100, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 105 | 2017-08-30T08:10:44.823079+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 3, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 106 | 2017-08-30T08:10:44.823083+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 25, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 107 | 2017-08-30T08:10:44.823088+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 108 | 2017-08-30T08:10:44.823093+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 109 | 2017-08-30T08:10:44.823098+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 110 | 2017-08-30T08:10:44.823103+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 111 | 2017-08-30T08:10:44.823107+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 112 | 2017-08-30T08:10:44.823111+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 113 | 2017-08-30T08:10:44.823116+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 114 | 2017-08-30T08:10:44.823121+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 115 | 2017-08-30T08:10:44.823125+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 116 | 2017-08-30T08:10:44.823142+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 117 | 2017-08-30T08:10:44.823150+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 3, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 2920, "bytes.decompressed": 0 } 118 | 2017-08-30T08:10:44.823159+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 6000, "stime": 6000, "maxrss": 5876, "minflt": 605, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 85, "nivcsw": 15, "openfiles": 17 } 119 | 2017-08-30T08:10:44.823165+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 154, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 120 | 2017-08-30T08:10:44.823169+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 121 | 2017-08-30T08:10:54.833332+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 122 | 2017-08-30T08:10:54.833352+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 33, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 123 | 2017-08-30T08:10:54.833359+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 124 | 2017-08-30T08:10:54.833365+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 120, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 125 | 2017-08-30T08:10:54.833371+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 3, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 126 | 2017-08-30T08:10:54.833375+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 25, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 127 | 2017-08-30T08:10:54.833380+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 128 | 2017-08-30T08:10:54.833385+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 129 | 2017-08-30T08:10:54.833391+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 130 | 2017-08-30T08:10:54.833395+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 131 | 2017-08-30T08:10:54.833400+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 132 | 2017-08-30T08:10:54.833404+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 133 | 2017-08-30T08:10:54.833409+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 134 | 2017-08-30T08:10:54.833414+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 135 | 2017-08-30T08:10:54.833419+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 136 | 2017-08-30T08:10:54.833423+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 137 | 2017-08-30T08:10:54.833430+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 3, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 2920, "bytes.decompressed": 0 } 138 | 2017-08-30T08:10:54.833439+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 6000, "stime": 6000, "maxrss": 5876, "minflt": 605, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 87, "nivcsw": 15, "openfiles": 17 } 139 | 2017-08-30T08:10:54.833445+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 174, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 140 | 2017-08-30T08:10:54.833449+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 141 | 2017-08-30T08:11:04.843631+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 142 | 2017-08-30T08:11:04.843651+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 36, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 143 | 2017-08-30T08:11:04.843659+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 144 | 2017-08-30T08:11:04.843665+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 140, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 145 | 2017-08-30T08:11:04.843671+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 3, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 146 | 2017-08-30T08:11:04.843675+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 28, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 147 | 2017-08-30T08:11:04.843680+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 148 | 2017-08-30T08:11:04.843685+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 149 | 2017-08-30T08:11:04.843690+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 150 | 2017-08-30T08:11:04.843695+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 151 | 2017-08-30T08:11:04.843699+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 152 | 2017-08-30T08:11:04.843703+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 153 | 2017-08-30T08:11:04.843709+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 154 | 2017-08-30T08:11:04.843713+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 155 | 2017-08-30T08:11:04.843718+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 156 | 2017-08-30T08:11:04.843722+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 157 | 2017-08-30T08:11:04.843729+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 3, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 2920, "bytes.decompressed": 0 } 158 | 2017-08-30T08:11:04.843739+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 7000, "stime": 6000, "maxrss": 5876, "minflt": 606, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 95, "nivcsw": 15, "openfiles": 17 } 159 | 2017-08-30T08:11:04.843744+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 197, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 160 | 2017-08-30T08:11:04.843749+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 161 | 2017-08-30T08:11:14.853927+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 162 | 2017-08-30T08:11:14.853946+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 36, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 163 | 2017-08-30T08:11:14.853954+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 164 | 2017-08-30T08:11:14.853960+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 160, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 165 | 2017-08-30T08:11:14.853965+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 3, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 166 | 2017-08-30T08:11:14.853970+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 28, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 167 | 2017-08-30T08:11:14.853974+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 168 | 2017-08-30T08:11:14.853980+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 169 | 2017-08-30T08:11:14.853985+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 170 | 2017-08-30T08:11:14.853990+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 171 | 2017-08-30T08:11:14.853994+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 172 | 2017-08-30T08:11:14.853998+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 173 | 2017-08-30T08:11:14.854003+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 174 | 2017-08-30T08:11:14.854008+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 175 | 2017-08-30T08:11:14.854012+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 176 | 2017-08-30T08:11:14.854017+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 177 | 2017-08-30T08:11:14.854023+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 3, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 2920, "bytes.decompressed": 0 } 178 | 2017-08-30T08:11:14.854031+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 7000, "stime": 6000, "maxrss": 5876, "minflt": 606, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 97, "nivcsw": 15, "openfiles": 17 } 179 | 2017-08-30T08:11:14.854037+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 217, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 180 | 2017-08-30T08:11:14.854041+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 181 | 2017-08-30T08:11:24.862793+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 182 | 2017-08-30T08:11:24.862812+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 36, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 183 | 2017-08-30T08:11:24.862820+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 184 | 2017-08-30T08:11:24.862826+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 180, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 185 | 2017-08-30T08:11:24.862831+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 3, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 186 | 2017-08-30T08:11:24.862835+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 28, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 187 | 2017-08-30T08:11:24.862840+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 188 | 2017-08-30T08:11:24.862845+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 189 | 2017-08-30T08:11:24.862851+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 190 | 2017-08-30T08:11:24.862855+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 191 | 2017-08-30T08:11:24.862860+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 192 | 2017-08-30T08:11:24.862864+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 193 | 2017-08-30T08:11:24.862869+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 194 | 2017-08-30T08:11:24.862874+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 195 | 2017-08-30T08:11:24.862879+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 196 | 2017-08-30T08:11:24.862883+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 197 | 2017-08-30T08:11:24.862890+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 3, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 2920, "bytes.decompressed": 0 } 198 | 2017-08-30T08:11:24.862899+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 7000, "stime": 6000, "maxrss": 5876, "minflt": 606, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 99, "nivcsw": 15, "openfiles": 17 } 199 | 2017-08-30T08:11:24.862905+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 237, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 200 | 2017-08-30T08:11:24.862909+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 201 | 2017-08-30T08:11:34.869986+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 202 | 2017-08-30T08:11:34.870005+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 39, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 203 | 2017-08-30T08:11:34.870013+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 204 | 2017-08-30T08:11:34.870019+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 200, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 205 | 2017-08-30T08:11:34.870024+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 3, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 206 | 2017-08-30T08:11:34.870029+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 31, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 207 | 2017-08-30T08:11:34.870034+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 208 | 2017-08-30T08:11:34.870039+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 209 | 2017-08-30T08:11:34.870045+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 210 | 2017-08-30T08:11:34.870049+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 211 | 2017-08-30T08:11:34.870053+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 212 | 2017-08-30T08:11:34.870058+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 213 | 2017-08-30T08:11:34.870063+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 214 | 2017-08-30T08:11:34.870068+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 215 | 2017-08-30T08:11:34.870072+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 216 | 2017-08-30T08:11:34.870077+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 217 | 2017-08-30T08:11:34.870084+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 3, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 2920, "bytes.decompressed": 0 } 218 | 2017-08-30T08:11:34.870093+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 8000, "stime": 6000, "maxrss": 5876, "minflt": 606, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 107, "nivcsw": 15, "openfiles": 17 } 219 | 2017-08-30T08:11:34.870099+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 260, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 220 | 2017-08-30T08:11:34.870103+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 221 | 2017-08-30T08:11:44.876344+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 222 | 2017-08-30T08:11:44.876364+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 39, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 223 | 2017-08-30T08:11:44.876372+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 224 | 2017-08-30T08:11:44.876378+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 220, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 225 | 2017-08-30T08:11:44.876383+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 3, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 226 | 2017-08-30T08:11:44.876388+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 31, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 227 | 2017-08-30T08:11:44.876392+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 228 | 2017-08-30T08:11:44.876398+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 229 | 2017-08-30T08:11:44.876403+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 230 | 2017-08-30T08:11:44.876408+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 231 | 2017-08-30T08:11:44.876412+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 232 | 2017-08-30T08:11:44.876417+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 233 | 2017-08-30T08:11:44.876422+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 234 | 2017-08-30T08:11:44.876427+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 235 | 2017-08-30T08:11:44.876432+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 236 | 2017-08-30T08:11:44.876436+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 237 | 2017-08-30T08:11:44.876443+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 3, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 2920, "bytes.decompressed": 0 } 238 | 2017-08-30T08:11:44.876452+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 8000, "stime": 6000, "maxrss": 5876, "minflt": 606, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 109, "nivcsw": 15, "openfiles": 17 } 239 | 2017-08-30T08:11:44.876458+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 280, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 240 | 2017-08-30T08:11:44.876462+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 241 | 2017-08-30T08:11:54.883536+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 242 | 2017-08-30T08:11:54.883554+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 39, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 243 | 2017-08-30T08:11:54.883562+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 244 | 2017-08-30T08:11:54.883568+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 240, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 245 | 2017-08-30T08:11:54.883574+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 4, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 246 | 2017-08-30T08:11:54.883578+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 31, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 247 | 2017-08-30T08:11:54.883583+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 248 | 2017-08-30T08:11:54.883588+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 249 | 2017-08-30T08:11:54.883593+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 250 | 2017-08-30T08:11:54.883598+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 251 | 2017-08-30T08:11:54.883602+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 252 | 2017-08-30T08:11:54.883606+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 253 | 2017-08-30T08:11:54.883612+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 254 | 2017-08-30T08:11:54.883616+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 255 | 2017-08-30T08:11:54.883621+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 256 | 2017-08-30T08:11:54.883625+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 257 | 2017-08-30T08:11:54.883632+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 4, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 3901, "bytes.decompressed": 0 } 258 | 2017-08-30T08:11:54.883641+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 8000, "stime": 6000, "maxrss": 5876, "minflt": 606, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 113, "nivcsw": 15, "openfiles": 17 } 259 | 2017-08-30T08:11:54.883647+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 301, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 260 | 2017-08-30T08:11:54.883651+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 261 | 2017-08-30T08:12:04.889209+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 262 | 2017-08-30T08:12:04.889228+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 42, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 263 | 2017-08-30T08:12:04.889236+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 264 | 2017-08-30T08:12:04.889243+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 260, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 265 | 2017-08-30T08:12:04.889248+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 4, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 266 | 2017-08-30T08:12:04.889253+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 34, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 267 | 2017-08-30T08:12:04.889258+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 268 | 2017-08-30T08:12:04.889263+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 269 | 2017-08-30T08:12:04.889268+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 270 | 2017-08-30T08:12:04.889273+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 271 | 2017-08-30T08:12:04.889277+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 272 | 2017-08-30T08:12:04.889282+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 273 | 2017-08-30T08:12:04.889287+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 274 | 2017-08-30T08:12:04.889292+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 275 | 2017-08-30T08:12:04.889296+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 276 | 2017-08-30T08:12:04.889301+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 277 | 2017-08-30T08:12:04.889308+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 4, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 3901, "bytes.decompressed": 0 } 278 | 2017-08-30T08:12:04.889317+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 8000, "stime": 7000, "maxrss": 5876, "minflt": 606, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 121, "nivcsw": 15, "openfiles": 17 } 279 | 2017-08-30T08:12:04.889322+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 324, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 280 | 2017-08-30T08:12:04.889327+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 281 | 2017-08-30T08:12:14.895862+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 282 | 2017-08-30T08:12:14.895881+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 42, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 283 | 2017-08-30T08:12:14.895889+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 284 | 2017-08-30T08:12:14.895895+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 280, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 285 | 2017-08-30T08:12:14.895900+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 4, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 286 | 2017-08-30T08:12:14.895905+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 34, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 287 | 2017-08-30T08:12:14.895909+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 288 | 2017-08-30T08:12:14.895914+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 289 | 2017-08-30T08:12:14.895920+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 290 | 2017-08-30T08:12:14.895924+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 291 | 2017-08-30T08:12:14.895929+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 292 | 2017-08-30T08:12:14.895933+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 293 | 2017-08-30T08:12:14.895938+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 294 | 2017-08-30T08:12:14.895943+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 295 | 2017-08-30T08:12:14.895948+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 296 | 2017-08-30T08:12:14.895952+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 297 | 2017-08-30T08:12:14.895959+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 4, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 3901, "bytes.decompressed": 0 } 298 | 2017-08-30T08:12:14.895968+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 8000, "stime": 7000, "maxrss": 5876, "minflt": 606, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 123, "nivcsw": 15, "openfiles": 17 } 299 | 2017-08-30T08:12:14.895974+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 344, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 300 | 2017-08-30T08:12:14.895978+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 301 | 2017-08-30T08:12:24.903554+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 302 | 2017-08-30T08:12:24.903574+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 42, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 303 | 2017-08-30T08:12:24.903582+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 304 | 2017-08-30T08:12:24.903588+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 300, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 305 | 2017-08-30T08:12:24.903593+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 4, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 306 | 2017-08-30T08:12:24.903598+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 34, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 307 | 2017-08-30T08:12:24.903602+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 308 | 2017-08-30T08:12:24.903608+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 309 | 2017-08-30T08:12:24.903613+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 310 | 2017-08-30T08:12:24.903617+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 311 | 2017-08-30T08:12:24.903622+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 312 | 2017-08-30T08:12:24.903626+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 313 | 2017-08-30T08:12:24.903631+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 314 | 2017-08-30T08:12:24.903636+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 315 | 2017-08-30T08:12:24.903641+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 316 | 2017-08-30T08:12:24.903645+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 317 | 2017-08-30T08:12:24.903652+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 4, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 3901, "bytes.decompressed": 0 } 318 | 2017-08-30T08:12:24.903661+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 8000, "stime": 7000, "maxrss": 5876, "minflt": 606, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 125, "nivcsw": 15, "openfiles": 17 } 319 | 2017-08-30T08:12:24.903667+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 364, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 320 | 2017-08-30T08:12:24.903671+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 321 | 2017-08-30T08:12:34.909129+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 322 | 2017-08-30T08:12:34.909151+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 45, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 323 | 2017-08-30T08:12:34.909159+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 324 | 2017-08-30T08:12:34.909166+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 320, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 325 | 2017-08-30T08:12:34.909171+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 4, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 326 | 2017-08-30T08:12:34.909176+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 37, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 327 | 2017-08-30T08:12:34.909181+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 328 | 2017-08-30T08:12:34.909186+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 329 | 2017-08-30T08:12:34.909192+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 330 | 2017-08-30T08:12:34.909196+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 331 | 2017-08-30T08:12:34.909218+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 332 | 2017-08-30T08:12:34.909223+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 333 | 2017-08-30T08:12:34.909229+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 334 | 2017-08-30T08:12:34.909233+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 335 | 2017-08-30T08:12:34.909238+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 336 | 2017-08-30T08:12:34.909243+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 337 | 2017-08-30T08:12:34.909250+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 4, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 3901, "bytes.decompressed": 0 } 338 | 2017-08-30T08:12:34.909259+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 9000, "stime": 7000, "maxrss": 5876, "minflt": 606, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 133, "nivcsw": 15, "openfiles": 17 } 339 | 2017-08-30T08:12:34.909265+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 387, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 340 | 2017-08-30T08:12:34.909269+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 341 | 2017-08-30T08:12:44.919198+00:00 some-node.example.org rsyslogd-pstats: { "name": "global", "origin": "dynstats", "values": { } } 342 | 2017-08-30T08:12:44.919216+00:00 some-node.example.org rsyslogd-pstats: { "name": "imuxsock", "origin": "imuxsock", "submitted": 45, "ratelimit.discarded": 0, "ratelimit.numratelimiters": 0 } 343 | 2017-08-30T08:12:44.919224+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 0", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 344 | 2017-08-30T08:12:44.919230+00:00 some-node.example.org rsyslogd-pstats: { "name": "to_exporter_2", "origin": "core.action", "processed": 340, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 345 | 2017-08-30T08:12:44.919235+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 3", "origin": "core.action", "processed": 4, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 346 | 2017-08-30T08:12:44.919239+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 4", "origin": "core.action", "processed": 37, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 347 | 2017-08-30T08:12:44.919244+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 5", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 348 | 2017-08-30T08:12:44.919249+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 7", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 349 | 2017-08-30T08:12:44.919254+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 10", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 350 | 2017-08-30T08:12:44.919259+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 11", "origin": "core.action", "processed": 6, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 351 | 2017-08-30T08:12:44.919263+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 12", "origin": "core.action", "processed": 2, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 352 | 2017-08-30T08:12:44.919267+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 13", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 353 | 2017-08-30T08:12:44.919272+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 14", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 354 | 2017-08-30T08:12:44.919277+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 15", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 355 | 2017-08-30T08:12:44.919281+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 16", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 356 | 2017-08-30T08:12:44.919286+00:00 some-node.example.org rsyslogd-pstats: { "name": "action 17", "origin": "core.action", "processed": 0, "failed": 0, "suspended": 0, "suspended.duration": 0, "resumed": 0 } 357 | 2017-08-30T08:12:44.919293+00:00 some-node.example.org rsyslogd-pstats: { "name": "imptcp(*\/\/var\/run\/go-audit.sock\/IPv4)", "origin": "imptcp", "submitted": 4, "sessions.opened": 0, "sessions.openfailed": 0, "sessions.closed": 1, "bytes.received": 3901, "bytes.decompressed": 0 } 358 | 2017-08-30T08:12:44.919301+00:00 some-node.example.org rsyslogd-pstats: { "name": "resource-usage", "origin": "impstats", "utime": 9000, "stime": 7000, "maxrss": 5876, "minflt": 606, "majflt": 0, "inblock": 0, "oublock": 0, "nvcsw": 135, "nivcsw": 15, "openfiles": 17 } 359 | 2017-08-30T08:12:44.919307+00:00 some-node.example.org rsyslogd-pstats: { "name": "main Q", "origin": "core.queue", "size": 18, "enqueued": 407, "full": 0, "discarded.full": 0, "discarded.nf": 0, "maxqsize": 20 } 360 | 2017-08-30T08:12:44.919311+00:00 some-node.example.org rsyslogd-pstats: { "name": "io-work-q", "origin": "imptcp", "enqueued": 0, "maxqsize": 0 } 361 | -------------------------------------------------------------------------------- /inputs.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type input struct { 9 | Name string `json:"name"` 10 | Submitted int64 `json:"submitted"` 11 | } 12 | 13 | func newInputFromJSON(b []byte) (*input, error) { 14 | var pstat input 15 | err := json.Unmarshal(b, &pstat) 16 | if err != nil { 17 | return nil, fmt.Errorf("error decoding input stat `%v`: %v", string(b), err) 18 | } 19 | return &pstat, nil 20 | } 21 | 22 | func (i *input) toPoints() []*point { 23 | points := make([]*point, 1) 24 | 25 | points[0] = &point{ 26 | Name: "input_submitted", 27 | Type: counter, 28 | Value: i.Submitted, 29 | Description: "messages submitted", 30 | LabelName: "input", 31 | LabelValue: i.Name, 32 | } 33 | 34 | return points 35 | } 36 | -------------------------------------------------------------------------------- /inputs_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "testing" 4 | 5 | var ( 6 | inputLog = []byte(`{"name":"test_input", "origin":"imuxsock", "submitted":1000}`) 7 | ) 8 | 9 | func TestgetInput(t *testing.T) { 10 | logType := getStatType(inputLog) 11 | if logType != rsyslogInput { 12 | t.Errorf("detected pstat type should be %d but is %d", rsyslogInput, logType) 13 | } 14 | 15 | pstat, err := newInputFromJSON([]byte(inputLog)) 16 | if err != nil { 17 | t.Fatalf("expected parsing input stat not to fail, got: %v", err) 18 | } 19 | 20 | if want, got := "test_input", pstat.Name; want != got { 21 | t.Errorf("want '%s', got '%s'", want, got) 22 | } 23 | 24 | if want, got := int64(1000), pstat.Submitted; want != got { 25 | t.Errorf("want '%d', got '%d'", want, got) 26 | } 27 | } 28 | 29 | func TestInputtoPoints(t *testing.T) { 30 | pstat, err := newInputFromJSON([]byte(inputLog)) 31 | if err != nil { 32 | t.Fatalf("expected parsing input stat not to fail, got: %v", err) 33 | } 34 | 35 | points := pstat.toPoints() 36 | 37 | point := points[0] 38 | if want, got := "input_submitted", point.Name; want != got { 39 | t.Errorf("want '%s', got '%s'", want, got) 40 | } 41 | 42 | if want, got := int64(1000), point.Value; want != got { 43 | t.Errorf("want '%d', got '%d'", want, got) 44 | } 45 | 46 | if want, got := "test_input", point.LabelValue; want != got { 47 | t.Errorf("wanted '%s', got '%s'", want, got) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "flag" 5 | "log" 6 | "log/syslog" 7 | "net/http" 8 | "os" 9 | "os/signal" 10 | 11 | "github.com/prometheus/client_golang/prometheus" 12 | ) 13 | 14 | var ( 15 | listenAddress = flag.String("web.listen-address", ":9104", "Address to listen on for web interface and telemetry.") 16 | metricPath = flag.String("web.telemetry-path", "/metrics", "Path under which to expose metrics.") 17 | ) 18 | 19 | func main() { 20 | logwriter, e := syslog.New(syslog.LOG_NOTICE|syslog.LOG_SYSLOG, "rsyslog_exporter") 21 | if e == nil { 22 | log.SetOutput(logwriter) 23 | } 24 | 25 | flag.Parse() 26 | exporter := newRsyslogExporter() 27 | 28 | go func() { 29 | c := make(chan os.Signal, 1) 30 | signal.Notify(c, os.Interrupt) 31 | <-c 32 | log.Print("interrupt received, exiting") 33 | os.Exit(0) 34 | }() 35 | 36 | go func() { 37 | exporter.run() 38 | }() 39 | 40 | prometheus.MustRegister(exporter) 41 | http.Handle(*metricPath, prometheus.Handler()) 42 | http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { 43 | w.Write([]byte(` 44 | Rsyslog exporter 45 | 46 |

Rsyslog exporter

47 |

Metrics

48 | 49 | 50 | `)) 51 | }) 52 | 53 | log.Printf("Listening on %s", *listenAddress) 54 | log.Fatal(http.ListenAndServe(*listenAddress, nil)) 55 | } 56 | -------------------------------------------------------------------------------- /point.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "errors" 5 | "fmt" 6 | 7 | "github.com/prometheus/client_golang/prometheus" 8 | ) 9 | 10 | type pointType int 11 | 12 | const ( 13 | counter pointType = iota 14 | gauge 15 | ) 16 | 17 | var ( 18 | ErrIncompatiblePointType = errors.New("incompatible point type") 19 | ErrUnknownPointType = errors.New("unknown point type") 20 | ) 21 | 22 | type point struct { 23 | Name string 24 | Description string 25 | Type pointType 26 | Value int64 27 | LabelName string 28 | LabelValue string 29 | } 30 | 31 | func (p *point) promDescription() *prometheus.Desc { 32 | return prometheus.NewDesc( 33 | prometheus.BuildFQName("", "rsyslog", p.Name), 34 | p.Description, 35 | []string{p.promLabelName()}, 36 | nil, 37 | ) 38 | } 39 | 40 | func (p *point) promType() prometheus.ValueType { 41 | if p.Type == counter { 42 | return prometheus.CounterValue 43 | } 44 | return prometheus.GaugeValue 45 | } 46 | 47 | func (p *point) promValue() float64 { 48 | return float64(p.Value) 49 | } 50 | 51 | func (p *point) promLabelValue() string { 52 | return p.LabelValue 53 | } 54 | 55 | func (p *point) promLabelName() string { 56 | return p.LabelName 57 | } 58 | 59 | func (p *point) key() string { 60 | return fmt.Sprintf("%s.%s", p.Name, p.LabelValue) 61 | } 62 | -------------------------------------------------------------------------------- /point_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/prometheus/client_golang/prometheus" 7 | ) 8 | 9 | func TestCounter(t *testing.T) { 10 | p1 := &point{ 11 | Name: "my counter", 12 | Type: counter, 13 | Value: int64(10), 14 | } 15 | 16 | if want, got := float64(10), p1.promValue(); want != got { 17 | t.Errorf("want '%f', got '%f'", want, got) 18 | } 19 | 20 | if want, got := prometheus.ValueType(1), p1.promType(); want != got { 21 | t.Errorf("want '%v', got '%v'", want, got) 22 | } 23 | 24 | wanted := `Desc{fqName: "rsyslog_my counter", help: "", constLabels: {}, variableLabels: []}` 25 | if want, got := wanted, p1.promDescription().String(); want != got { 26 | t.Errorf("want '%s', got '%s'", want, got) 27 | } 28 | } 29 | 30 | func TestGauge(t *testing.T) { 31 | p1 := &point{ 32 | Name: "my gauge", 33 | Type: gauge, 34 | Value: int64(10), 35 | } 36 | 37 | if want, got := float64(10), p1.promValue(); want != got { 38 | t.Errorf("want '%f', got '%f'", want, got) 39 | } 40 | 41 | if want, got := prometheus.ValueType(2), p1.promType(); want != got { 42 | t.Errorf("want '%v', got '%v'", want, got) 43 | } 44 | 45 | wanted := `Desc{fqName: "rsyslog_my gauge", help: "", constLabels: {}, variableLabels: []}` 46 | if want, got := wanted, p1.promDescription().String(); want != got { 47 | t.Errorf("want '%s', got '%s'", want, got) 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /pointstore.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "errors" 5 | "sort" 6 | "sync" 7 | ) 8 | 9 | var ( 10 | ErrPointNotFound = errors.New("point does not exist") 11 | ) 12 | 13 | type pointStore struct { 14 | pointMap map[string]*point 15 | lock *sync.RWMutex 16 | } 17 | 18 | func newPointStore() *pointStore { 19 | return &pointStore{ 20 | pointMap: make(map[string]*point), 21 | lock: &sync.RWMutex{}, 22 | } 23 | } 24 | 25 | func (ps *pointStore) keys() []string { 26 | ps.lock.Lock() 27 | keys := make([]string, 0) 28 | for k, _ := range ps.pointMap { 29 | keys = append(keys, k) 30 | } 31 | sort.Strings(keys) 32 | ps.lock.Unlock() 33 | return keys 34 | } 35 | 36 | func (ps *pointStore) set(p *point) error { 37 | var err error 38 | ps.lock.Lock() 39 | ps.pointMap[p.key()] = p 40 | ps.lock.Unlock() 41 | return err 42 | } 43 | 44 | func (ps *pointStore) get(name string) (*point, error) { 45 | ps.lock.Lock() 46 | if p, ok := ps.pointMap[name]; ok { 47 | ps.lock.Unlock() 48 | return p, nil 49 | } 50 | ps.lock.Unlock() 51 | return &point{}, ErrPointNotFound 52 | } 53 | -------------------------------------------------------------------------------- /pointstore_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "testing" 4 | 5 | func TestPointStore(t *testing.T) { 6 | ps := newPointStore() 7 | 8 | s1 := &point{ 9 | Name: "my counter", 10 | Type: counter, 11 | Value: int64(10), 12 | } 13 | 14 | s2 := &point{ 15 | Name: "my counter", 16 | Type: counter, 17 | Value: int64(5), 18 | } 19 | 20 | err := ps.set(s1) 21 | if err != nil { 22 | t.Error(err) 23 | } 24 | 25 | got, err := ps.get(s1.key()) 26 | if err != nil { 27 | t.Error(err) 28 | } 29 | 30 | if want, got := int64(10), got.Value; want != got { 31 | t.Errorf("want '%d', got '%d'", want, got) 32 | } 33 | 34 | err = ps.set(s2) 35 | if err != nil { 36 | t.Error(err) 37 | } 38 | 39 | got, err = ps.get(s2.key()) 40 | if err != nil { 41 | t.Error(err) 42 | } 43 | 44 | if want, got := int64(5), got.Value; want != got { 45 | t.Errorf("want '%d', got '%d'", want, got) 46 | } 47 | 48 | s3 := &point{ 49 | Name: "my gauge", 50 | Type: gauge, 51 | Value: int64(20), 52 | } 53 | 54 | err = ps.set(s3) 55 | if err != nil { 56 | t.Error(err) 57 | } 58 | 59 | got, err = ps.get(s3.key()) 60 | if err != nil { 61 | t.Error(err) 62 | } 63 | 64 | if want, got := int64(20), got.Value; want != got { 65 | t.Errorf("want '%d', got '%d'", want, got) 66 | } 67 | 68 | s4 := &point{ 69 | Name: "my gauge", 70 | Type: gauge, 71 | Value: int64(15), 72 | } 73 | 74 | err = ps.set(s4) 75 | if err != nil { 76 | t.Error(err) 77 | } 78 | 79 | got, err = ps.get(s4.key()) 80 | if err != nil { 81 | t.Error(err) 82 | } 83 | 84 | if want, got := int64(15), got.Value; want != got { 85 | t.Errorf("want '%d', got '%d'", want, got) 86 | } 87 | 88 | _, err = ps.get("no point") 89 | if err != ErrPointNotFound { 90 | t.Error("getting non existent point should raise error") 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /queues.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type queue struct { 9 | Name string `json:"name"` 10 | Size int64 `json:"size"` 11 | Enqueued int64 `json:"enqueued"` 12 | Full int64 `json:"full"` 13 | DiscardedFull int64 `json:"discarded.full"` 14 | DiscardedNf int64 `json:"discarded.nf"` 15 | MaxQsize int64 `json:"maxqsize"` 16 | } 17 | 18 | func newQueueFromJSON(b []byte) (*queue, error) { 19 | var pstat queue 20 | err := json.Unmarshal(b, &pstat) 21 | if err != nil { 22 | return nil, fmt.Errorf("failed to decode queue stat `%v`: %v", string(b), err) 23 | } 24 | return &pstat, nil 25 | } 26 | 27 | func (q *queue) toPoints() []*point { 28 | points := make([]*point, 6) 29 | 30 | points[0] = &point{ 31 | Name: "queue_size", 32 | Type: gauge, 33 | Value: q.Size, 34 | Description: "messages currently in queue", 35 | LabelName: "queue", 36 | LabelValue: q.Name, 37 | } 38 | 39 | points[1] = &point{ 40 | Name: "queue_enqueued", 41 | Type: counter, 42 | Value: q.Enqueued, 43 | Description: "total messages enqueued", 44 | LabelName: "queue", 45 | LabelValue: q.Name, 46 | } 47 | 48 | points[2] = &point{ 49 | Name: "queue_full", 50 | Type: counter, 51 | Value: q.Full, 52 | Description: "times queue was full", 53 | LabelName: "queue", 54 | LabelValue: q.Name, 55 | } 56 | 57 | points[3] = &point{ 58 | Name: "queue_discarded_full", 59 | Type: counter, 60 | Value: q.DiscardedFull, 61 | Description: "messages discarded due to queue being full", 62 | LabelName: "queue", 63 | LabelValue: q.Name, 64 | } 65 | 66 | points[4] = &point{ 67 | Name: "queue_discarded_not_full", 68 | Type: counter, 69 | Value: q.DiscardedNf, 70 | Description: "messages discarded when queue not full", 71 | LabelName: "queue", 72 | LabelValue: q.Name, 73 | } 74 | 75 | points[5] = &point{ 76 | Name: "queue_max_size", 77 | Type: gauge, 78 | Value: q.MaxQsize, 79 | Description: "maximum size queue has reached", 80 | LabelName: "queue", 81 | LabelValue: q.Name, 82 | } 83 | 84 | return points 85 | } 86 | -------------------------------------------------------------------------------- /queues_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "testing" 4 | 5 | var ( 6 | queueStat = []byte(`{"name":"main Q","size":10,"enqueued":20,"full":30,"discarded.full":40,"discarded.nf":50,"maxqsize":60}`) 7 | ) 8 | 9 | func TestNewQueueFromJSON(t *testing.T) { 10 | logType := getStatType(queueStat) 11 | if logType != rsyslogQueue { 12 | t.Errorf("detected pstat type should be %d but is %d", rsyslogQueue, logType) 13 | } 14 | 15 | pstat, err := newQueueFromJSON([]byte(queueStat)) 16 | if err != nil { 17 | t.Fatalf("expected parsing queue stat not to fail, got: %v", err) 18 | } 19 | 20 | if want, got := "main Q", pstat.Name; want != got { 21 | t.Errorf("want '%s', got '%s'", want, got) 22 | } 23 | 24 | if want, got := int64(10), pstat.Size; want != got { 25 | t.Errorf("want '%d', got '%d'", want, got) 26 | } 27 | 28 | if want, got := int64(20), pstat.Enqueued; want != got { 29 | t.Errorf("want '%d', got '%d'", want, got) 30 | } 31 | 32 | if want, got := int64(30), pstat.Full; want != got { 33 | t.Errorf("want '%d', got '%d'", want, got) 34 | } 35 | 36 | if want, got := int64(40), pstat.DiscardedFull; want != got { 37 | t.Errorf("want '%d', got '%d'", want, got) 38 | } 39 | 40 | if want, got := int64(50), pstat.DiscardedNf; want != got { 41 | t.Errorf("want '%d', got '%d'", want, got) 42 | } 43 | 44 | if want, got := int64(60), pstat.MaxQsize; want != got { 45 | t.Errorf("want '%d', got '%d'", want, got) 46 | } 47 | } 48 | 49 | func TestQueueToPoints(t *testing.T) { 50 | pstat, err := newQueueFromJSON([]byte(queueStat)) 51 | if err != nil { 52 | t.Fatalf("expected parsing queue stat not to fail, got: %v", err) 53 | } 54 | points := pstat.toPoints() 55 | 56 | point := points[0] 57 | if want, got := "queue_size", point.Name; want != got { 58 | t.Errorf("want '%s', got '%s'", want, got) 59 | } 60 | 61 | if want, got := int64(10), point.Value; want != got { 62 | } 63 | 64 | if want, got := gauge, point.Type; want != got { 65 | } 66 | 67 | if want, got := "main Q", point.LabelValue; want != got { 68 | t.Errorf("wanted '%s', got '%s'", want, got) 69 | } 70 | 71 | point = points[1] 72 | if want, got := "queue_enqueued", point.Name; want != got { 73 | t.Errorf("want '%s', got '%s'", want, got) 74 | } 75 | 76 | if want, got := int64(20), point.Value; want != got { 77 | t.Errorf("want '%d', got '%d'", want, got) 78 | } 79 | 80 | if want, got := counter, point.Type; want != got { 81 | t.Errorf("want '%d', got '%d'", want, got) 82 | } 83 | 84 | if want, got := "main Q", point.LabelValue; want != got { 85 | t.Errorf("wanted '%s', got '%s'", want, got) 86 | } 87 | 88 | point = points[2] 89 | if want, got := "queue_full", point.Name; want != got { 90 | t.Errorf("want '%s', got '%s'", want, got) 91 | } 92 | 93 | if want, got := int64(30), point.Value; want != got { 94 | t.Errorf("want '%d', got '%d'", want, got) 95 | } 96 | 97 | if want, got := counter, point.Type; want != got { 98 | t.Errorf("want '%d', got '%d'", want, got) 99 | } 100 | 101 | if want, got := "main Q", point.LabelValue; want != got { 102 | t.Errorf("wanted '%s', got '%s'", want, got) 103 | } 104 | 105 | point = points[3] 106 | if want, got := "queue_discarded_full", point.Name; want != got { 107 | t.Errorf("want '%s', got '%s'", want, got) 108 | } 109 | 110 | if want, got := int64(40), point.Value; want != got { 111 | t.Errorf("want '%d', got '%d'", want, got) 112 | } 113 | 114 | if want, got := counter, point.Type; want != got { 115 | t.Errorf("want '%d', got '%d'", want, got) 116 | } 117 | 118 | if want, got := "main Q", point.LabelValue; want != got { 119 | t.Errorf("wanted '%s', got '%s'", want, got) 120 | } 121 | 122 | point = points[4] 123 | if want, got := "queue_discarded_not_full", point.Name; want != got { 124 | t.Errorf("want '%s', got '%s'", want, got) 125 | } 126 | 127 | if want, got := int64(50), point.Value; want != got { 128 | t.Errorf("want '%d', got '%d'", want, got) 129 | } 130 | 131 | if want, got := counter, point.Type; want != got { 132 | t.Errorf("want '%d', got '%d'", want, got) 133 | } 134 | 135 | if want, got := "main Q", point.LabelValue; want != got { 136 | t.Errorf("wanted '%s', got '%s'", want, got) 137 | } 138 | 139 | point = points[5] 140 | if want, got := "queue_max_size", point.Name; want != got { 141 | t.Errorf("want '%s', got '%s'", want, got) 142 | } 143 | 144 | if want, got := int64(60), point.Value; want != got { 145 | t.Errorf("want '%d', got '%d'", want, got) 146 | } 147 | 148 | if want, got := gauge, point.Type; want != got { 149 | t.Errorf("want '%d', got '%d'", want, got) 150 | } 151 | 152 | if want, got := "main Q", point.LabelValue; want != got { 153 | t.Errorf("wanted '%s', got '%s'", want, got) 154 | } 155 | } 156 | -------------------------------------------------------------------------------- /resources.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "fmt" 6 | ) 7 | 8 | type resource struct { 9 | Name string `json:"name"` 10 | Utime int64 `json:"utime"` 11 | Stime int64 `json:"stime"` 12 | Maxrss int64 `json:"maxrss"` 13 | Minflt int64 `json:"minflt"` 14 | Majflt int64 `json:"majflt"` 15 | Inblock int64 `json:"inblock"` 16 | Outblock int64 `json:"oublock"` 17 | Nvcsw int64 `json:"nvcsw"` 18 | Nivcsw int64 `json:"nivcsw"` 19 | } 20 | 21 | func newResourceFromJSON(b []byte) (*resource, error) { 22 | var pstat resource 23 | err := json.Unmarshal(b, &pstat) 24 | if err != nil { 25 | return nil, fmt.Errorf("failed to decode resource stat `%v`: %v", string(b), err) 26 | } 27 | return &pstat, nil 28 | } 29 | 30 | func (r *resource) toPoints() []*point { 31 | points := make([]*point, 9) 32 | 33 | points[0] = &point{ 34 | Name: "resource_utime", 35 | Type: counter, 36 | Value: r.Utime, 37 | Description: "user time used in microseconds", 38 | LabelName: "resource", 39 | LabelValue: r.Name, 40 | } 41 | 42 | points[1] = &point{ 43 | Name: "resource_stime", 44 | Type: counter, 45 | Value: r.Stime, 46 | Description: "system time used in microsends", 47 | LabelName: "resource", 48 | LabelValue: r.Name, 49 | } 50 | 51 | points[2] = &point{ 52 | Name: "resource_maxrss", 53 | Type: gauge, 54 | Value: r.Maxrss, 55 | Description: "maximum resident set size", 56 | LabelName: "resource", 57 | LabelValue: r.Name, 58 | } 59 | 60 | points[3] = &point{ 61 | Name: "resource_minflt", 62 | Type: counter, 63 | Value: r.Minflt, 64 | Description: "total minor faults", 65 | LabelName: "resource", 66 | LabelValue: r.Name, 67 | } 68 | 69 | points[4] = &point{ 70 | Name: "resource_majflt", 71 | Type: counter, 72 | Value: r.Majflt, 73 | Description: "total major faults", 74 | LabelName: "resource", 75 | LabelValue: r.Name, 76 | } 77 | 78 | points[5] = &point{ 79 | Name: "resource_inblock", 80 | Type: counter, 81 | Value: r.Inblock, 82 | Description: "filesystem input operations", 83 | LabelName: "resource", 84 | LabelValue: r.Name, 85 | } 86 | 87 | points[6] = &point{ 88 | Name: "resource_oublock", 89 | Type: counter, 90 | Value: r.Outblock, 91 | Description: "filesystem output operations", 92 | LabelName: "resource", 93 | LabelValue: r.Name, 94 | } 95 | 96 | points[7] = &point{ 97 | Name: "resource_nvcsw", 98 | Type: counter, 99 | Value: r.Nvcsw, 100 | Description: "voluntary context switches", 101 | LabelName: "resource", 102 | LabelValue: r.Name, 103 | } 104 | 105 | points[8] = &point{ 106 | Name: "resource_nivcsw", 107 | Type: counter, 108 | Value: r.Nivcsw, 109 | Description: "involuntary context switches", 110 | LabelName: "resource", 111 | LabelValue: r.Name, 112 | } 113 | 114 | return points 115 | } 116 | -------------------------------------------------------------------------------- /resources_test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "testing" 4 | 5 | var ( 6 | resourceLog = []byte(`{"name":"resource-usage","utime":10,"stime":20,"maxrss":30,"minflt":40,"majflt":50,"inblock":60,"oublock":70,"nvcsw":80,"nivcsw":90}`) 7 | ) 8 | 9 | func TestNewResourceFromJSON(t *testing.T) { 10 | logType := getStatType(resourceLog) 11 | if logType != rsyslogResource { 12 | t.Errorf("detected pstat type should be %d but is %d", rsyslogResource, logType) 13 | } 14 | 15 | pstat, err := newResourceFromJSON([]byte(resourceLog)) 16 | if err != nil { 17 | t.Fatalf("expected parsing resource stat not to fail, got: %v", err) 18 | } 19 | 20 | if want, got := "resource-usage", pstat.Name; want != got { 21 | t.Errorf("want '%s', got '%s'", want, got) 22 | } 23 | 24 | if want, got := int64(10), pstat.Utime; want != got { 25 | t.Errorf("want '%d', got '%d'", want, got) 26 | } 27 | 28 | if want, got := int64(20), pstat.Stime; want != got { 29 | t.Errorf("want '%d', got '%d'", want, got) 30 | } 31 | 32 | if want, got := int64(30), pstat.Maxrss; want != got { 33 | t.Errorf("want '%d', got '%d'", want, got) 34 | } 35 | 36 | if want, got := int64(40), pstat.Minflt; want != got { 37 | t.Errorf("want '%d', got '%d'", want, got) 38 | } 39 | 40 | if want, got := int64(50), pstat.Majflt; want != got { 41 | t.Errorf("want '%d', got '%d'", want, got) 42 | } 43 | 44 | if want, got := int64(60), pstat.Inblock; want != got { 45 | t.Errorf("want '%d', got '%d'", want, got) 46 | } 47 | 48 | if want, got := int64(70), pstat.Outblock; want != got { 49 | t.Errorf("want '%d', got '%d'", want, got) 50 | } 51 | 52 | if want, got := int64(80), pstat.Nvcsw; want != got { 53 | t.Errorf("want '%d', got '%d'", want, got) 54 | } 55 | 56 | if want, got := int64(90), pstat.Nivcsw; want != got { 57 | t.Errorf("want '%d', got '%d'", want, got) 58 | } 59 | } 60 | 61 | func TestResourceToPoints(t *testing.T) { 62 | pstat, err := newResourceFromJSON([]byte(resourceLog)) 63 | if err != nil { 64 | t.Fatalf("expected parsing resource stat not to fail, got: %v", err) 65 | } 66 | points := pstat.toPoints() 67 | 68 | point := points[0] 69 | if want, got := "resource_utime", point.Name; want != got { 70 | t.Errorf("want '%s', got '%s'", want, got) 71 | } 72 | 73 | if want, got := int64(10), point.Value; want != got { 74 | t.Errorf("want '%d', got '%d'", want, got) 75 | } 76 | 77 | if want, got := counter, point.Type; want != got { 78 | t.Errorf("want '%d', got '%d'", want, got) 79 | } 80 | 81 | if want, got := "resource-usage", point.LabelValue; want != got { 82 | t.Errorf("wanted '%s', got '%s'", want, got) 83 | } 84 | 85 | point = points[1] 86 | if want, got := "resource_stime", point.Name; want != got { 87 | t.Errorf("want '%s', got '%s'", want, got) 88 | } 89 | 90 | if want, got := int64(20), point.Value; want != got { 91 | t.Errorf("want '%d', got '%d'", want, got) 92 | } 93 | 94 | if want, got := counter, point.Type; want != got { 95 | t.Errorf("want '%d', got '%d'", want, got) 96 | } 97 | 98 | if want, got := "resource-usage", point.LabelValue; want != got { 99 | t.Errorf("wanted '%s', got '%s'", want, got) 100 | } 101 | 102 | point = points[2] 103 | if want, got := "resource_maxrss", point.Name; want != got { 104 | t.Errorf("want '%s', got '%s'", want, got) 105 | } 106 | 107 | if want, got := int64(30), point.Value; want != got { 108 | t.Errorf("want '%d', got '%d'", want, got) 109 | } 110 | 111 | if want, got := gauge, point.Type; want != got { 112 | t.Errorf("want '%d', got '%d'", want, got) 113 | } 114 | 115 | if want, got := "resource-usage", point.LabelValue; want != got { 116 | t.Errorf("wanted '%s', got '%s'", want, got) 117 | } 118 | 119 | point = points[3] 120 | if want, got := "resource_minflt", point.Name; want != got { 121 | t.Errorf("want '%s', got '%s'", want, got) 122 | } 123 | 124 | if want, got := int64(40), point.Value; want != got { 125 | t.Errorf("want '%d', got '%d'", want, got) 126 | } 127 | 128 | if want, got := counter, point.Type; want != got { 129 | t.Errorf("want '%d', got '%d'", want, got) 130 | } 131 | 132 | if want, got := "resource-usage", point.LabelValue; want != got { 133 | t.Errorf("wanted '%s', got '%s'", want, got) 134 | } 135 | 136 | point = points[4] 137 | if want, got := "resource_majflt", point.Name; want != got { 138 | t.Errorf("want '%s', got '%s'", want, got) 139 | } 140 | 141 | if want, got := int64(50), point.Value; want != got { 142 | t.Errorf("want '%d', got '%d'", want, got) 143 | } 144 | 145 | if want, got := counter, point.Type; want != got { 146 | t.Errorf("want '%d', got '%d'", want, got) 147 | } 148 | 149 | if want, got := "resource-usage", point.LabelValue; want != got { 150 | t.Errorf("wanted '%s', got '%s'", want, got) 151 | } 152 | 153 | point = points[5] 154 | if want, got := "resource_inblock", point.Name; want != got { 155 | t.Errorf("want '%s', got '%s'", want, got) 156 | } 157 | 158 | if want, got := int64(60), point.Value; want != got { 159 | t.Errorf("want '%d', got '%d'", want, got) 160 | } 161 | 162 | if want, got := counter, point.Type; want != got { 163 | t.Errorf("want '%d', got '%d'", want, got) 164 | } 165 | 166 | if want, got := "resource-usage", point.LabelValue; want != got { 167 | t.Errorf("wanted '%s', got '%s'", want, got) 168 | } 169 | 170 | point = points[6] 171 | if want, got := "resource_oublock", point.Name; want != got { 172 | t.Errorf("want '%s', got '%s'", want, got) 173 | } 174 | 175 | if want, got := int64(70), point.Value; want != got { 176 | t.Errorf("want '%d', got '%d'", want, got) 177 | } 178 | 179 | if want, got := counter, point.Type; want != got { 180 | t.Errorf("want '%d', got '%d'", want, got) 181 | } 182 | 183 | if want, got := "resource-usage", point.LabelValue; want != got { 184 | t.Errorf("wanted '%s', got '%s'", want, got) 185 | } 186 | 187 | point = points[7] 188 | if want, got := "resource_nvcsw", point.Name; want != got { 189 | t.Errorf("want '%s', got '%s'", want, got) 190 | } 191 | 192 | if want, got := int64(80), point.Value; want != got { 193 | t.Errorf("want '%d', got '%d'", want, got) 194 | } 195 | 196 | if want, got := counter, point.Type; want != got { 197 | t.Errorf("want '%d', got '%d'", want, got) 198 | } 199 | 200 | if want, got := "resource-usage", point.LabelValue; want != got { 201 | t.Errorf("wanted '%s', got '%s'", want, got) 202 | } 203 | 204 | point = points[8] 205 | if want, got := "resource_nivcsw", point.Name; want != got { 206 | t.Errorf("want '%s', got '%s'", want, got) 207 | } 208 | 209 | if want, got := int64(90), point.Value; want != got { 210 | t.Errorf("want '%d', got '%d'", want, got) 211 | } 212 | 213 | if want, got := counter, point.Type; want != got { 214 | t.Errorf("want '%d', got '%d'", want, got) 215 | } 216 | 217 | if want, got := "resource-usage", point.LabelValue; want != got { 218 | t.Errorf("wanted '%s', got '%s'", want, got) 219 | } 220 | } 221 | -------------------------------------------------------------------------------- /utils.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "strings" 4 | 5 | func getStatType(buf []byte) rsyslogType { 6 | line := string(buf) 7 | if strings.Contains(line, "processed") { 8 | return rsyslogAction 9 | } else if strings.Contains(line, "submitted") { 10 | return rsyslogInput 11 | } else if strings.Contains(line, "enqueued") { 12 | return rsyslogQueue 13 | } else if strings.Contains(line, "utime") { 14 | return rsyslogResource 15 | } else if strings.Contains(line, "dynstats") { 16 | return rsyslogDynStat 17 | } 18 | return rsyslogUnknown 19 | } 20 | --------------------------------------------------------------------------------