diff --git a/config.json b/config.json index 282432fb..f9148952 100644 --- a/config.json +++ b/config.json @@ -1,107 +1,99 @@ { - "username": "admin", - "password": "sros", - "port": 57400, - "timeout": "5s", - "skip-verify": true, - "tls-key": "/path/to/client.key", - "tls-cert": "/path/to/client.crt", - "tls-ca": "/path/to/ca.crt", - "targets": { - "172.17.0.100": { - "timeout": "2s", - "subscriptions": [ - "sub1" - ], - "outputs": [ - "group1", - "group3" - ] + "username": "admin", + "password": "sros", + "port": 57400, + "timeout": "5s", + "skip-verify": true, + "tls-key": "/path/to/client.key", + "tls-cert": "/path/to/client.crt", + "tls-ca": "/path/to/ca.crt", + "targets": { + "172.17.0.100": { + "timeout": "2s", + "subscriptions": [ + "sub1" + ], + "outputs": [ + "output1", + "output3" + ] + }, + "172.17.0.101": { + "username": "sros", + "password": "sros", + "insecure": true, + "subscriptions": [ + "sub2" + ], + "outputs": [ + "output2", + "output3" + ] + }, + "172.17.0.102:57000": { + "password": "sros123", + "tls-key": "/path/file1", + "tls-cert": "/path/file2" + }, + "172.17.0.103": null }, - "172.17.0.101": { - "username": "sros", - "password": "sros", - "insecure": true, - "subscriptions": [ - "sub2" - ], - "outputs": [ - "group2", - "group3" - ] + "subscriptions": { + "sub1": { + "paths": [ + "/configure/port[port-id=*]", + "/state/port[port-id=*]" + ], + "stream-mode": "on_change" + }, + "sub2": { + "paths": [ + "/configure/port[port-id=*]/statistics" + ], + "stream-mode": "sample", + "sample-interval": "10s" + } }, - "172.17.0.102:57000": { - "password": "sros123", - "tls-key": "/path/file1", - "tls-cert": "/path/file2" - }, - "172.17.0.103": null - }, - "subscriptions": { - "sub1": { - "paths": [ - "/configure/port[port-id=*]", - "/state/port[port-id=*]" - ], - "stream-mode": "on_change" - }, - "sub2": { - "paths": [ - "/configure/port[port-id=*]/statistics" - ], - "stream-mode": "sample", - "sample-interval": "10s" + "outputs": { + "output1": { + "type": "file", + "file-type": "stdout" + }, + "output2": { + "type": "file", + "filename": "local.log" + }, + "output3": { + "type": "nats", + "address": "localhost:4222", + "subject-prefix": "telemetry", + "username": null, + "password": null + }, + "output4": { + "type": "stan", + "address": "localhost:4223", + "subject": "telemetry", + "username": null, + "password": null, + "name": null, + "cluster-name": "test-cluster", + "timeout": null, + "ping-interval": null, + "ping-retry": null + }, + "output5": { + "type": "kafka", + "address": "localhost:9092", + "topic": "telemetry", + "max-retry": null, + "timeout": null + }, + "output6": { + "type": "nats", + "address": "localhost:4222", + "subject-prefix": "telemetry", + "username": null, + "password": null + } } - }, - "outputs": { - "group1": [ - { - "type": "file", - "file-type": "stdout" - } - ], - "group2": [ - { - "type": "file", - "filename": "local.log" - }, - { - "type": "nats", - "address": "localhost:4222", - "subject-prefix": "telemetry", - "username": null, - "password": null - } - ], - "group3": [ - { - "type": "stan", - "address": "localhost:4223", - "subject": "telemetry", - "username": null, - "password": null, - "name": null, - "cluster-name": "test-cluster", - "timeout": null, - "ping-interval": null, - "ping-retry": null - } - ], - "group4": [ - { - "type": "kafka", - "address": "localhost:9092", - "topic": "telemetry", - "max-retry": null, - "timeout": null - }, - { - "type": "nats", - "address": "localhost:4222", - "subject-prefix": "telemetry", - "username": null, - "password": null - } - ] - } } \ No newline at end of file diff --git a/config.toml b/config.toml index b696a580..99237dcf 100644 --- a/config.toml +++ b/config.toml @@ -8,80 +8,66 @@ tls-cert = "/path/to/client.crt" tls-ca = "/path/to/ca.crt" [targets] - [targets."172.17.0.100"] timeout = "2s" - subscriptions = [ - "sub1" - ] - ouputs = [ - "group1", - "group3" - ] + subscriptions = [ "sub1" ] + outputs = [ + "output1", + "output3" + ] [targets."172.17.0.101"] username = "sros" password = "sros" insecure = true - subscriptions = [ - "sub2" - ] - outputs = [ - "group2", - "group3" - ] + subscriptions = [ "sub2" ] + outputs = [ + "output2", + "output3" + ] [targets."172.17.0.102:57000"] password = "sros123" tls-key = "/path/file1" tls-cert = "/path/file2" - [targets."172.17.0.103"] - -[subscriptions] - - [subscriptions.sub1] - paths = [ - "/configure/port[port-id=*]", - "/state/port[port-id=*]" - ] - stream-mode = "on_change" - - [subscriptions.sub2] - paths = [ - "/configure/port[port-id=*]/statistics" +[subscriptions.sub1] +paths = [ + "/configure/port[port-id=*]", + "/state/port[port-id=*]" ] - stream-mode = "sample" - sample-interval = "10s" +stream-mode = "on_change" -[outputs] +[subscriptions.sub2] +paths = [ "/configure/port[port-id=*]/statistics" ] +stream-mode = "sample" +sample-interval = "10s" - [[outputs.group1]] - type = "file" - file-type = "stdout" +[outputs.output1] +type = "file" +file-type = "stdout" - [[outputs.group2]] - type = "file" - filename = "local.log" +[outputs.output2] +type = "file" +filename = "local.log" - [[outputs.group2]] - type = "nats" - address = "localhost:4222" - subject-prefix = "telemetry" +[outputs.output3] +type = "nats" +address = "localhost:4222" +subject-prefix = "telemetry" - [[outputs.group3]] - type = "stan" - address = "localhost:4223" - subject = "telemetry" - cluster-name = "test-cluster" +[outputs.output4] +type = "stan" +address = "localhost:4223" +subject = "telemetry" +cluster-name = "test-cluster" - [[outputs.group4]] - type = "kafka" - address = "localhost:9092" - topic = "telemetry" +[outputs.output5] +type = "kafka" +address = "localhost:9092" +topic = "telemetry" - [[outputs.group4]] - type = "nats" - address = "localhost:4222" - subject-prefix = "telemetry" - \ No newline at end of file +[outputs.output6] +type = "nats" +address = "localhost:4222" +subject-prefix = "telemetry" diff --git a/config.yaml b/config.yaml index 00871c79..051e4d17 100644 --- a/config.yaml +++ b/config.yaml @@ -13,8 +13,8 @@ targets: subscriptions: - sub1 outputs: - - group1 - - group3 + - output1 + - output3 172.17.0.101: username: sros password: sros @@ -22,8 +22,8 @@ targets: subscriptions: - sub2 outputs: - - group2 - - group3 + - output2 + - output3 172.17.0.102:57000: password: sros123 tls-key: /path/file1 @@ -43,36 +43,38 @@ subscriptions: sample-interval: 10s outputs: - group1: - - type: file - file-type: stdout - group2: - - type: file - filename: local.log - - type: nats - address: localhost:4222 - subject-prefix: telemetry - username: - password: - group3: - - type: stan - address: localhost:4223 - subject: telemetry - username: - password: - name: - cluster-name: test-cluster - timeout: - ping-interval: - ping-retry: - group4: - - type: kafka - address: localhost:9092 - topic: telemetry - max-retry: - timeout: - - type: nats - address: localhost:4222 - subject-prefix: telemetry - username: - password: + output1: + type: file + file-type: stdout + output2: + type: file + filename: local.log + output3: + type: nats + address: localhost:4222 + subject-prefix: telemetry + username: + password: + output4: + type: stan + address: localhost:4223 + subject: telemetry + username: + password: + name: + cluster-name: test-cluster + timeout: + ping-interval: + ping-retry: + output5: + type: kafka + address: localhost:9092 + topic: telemetry + max-retry: + timeout: + output6: + type: nats + address: localhost:4222 + subject-prefix: telemetry + username: + password: