-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.example.yaml
159 lines (153 loc) · 4.16 KB
/
config.example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
broker:
client_id: "my_client_id"
username: "yourusernamehere"
password: "yourpasswordhere"
use_tls: false
last_will:
topic: "mqtli/lwt"
payload: "Good bye"
topics:
- topic: mqtli/test
subscription:
enabled: false
qos: 1
outputs:
- format:
type: yaml
- format:
type: json
- format:
type: text
- format:
type: hex
- format:
type: base64
- format:
type: raw
- format:
type: base64
target:
type: file
path: "log.txt"
overwrite: false
prepend: "MESSAGE: " # prepends the string "MESSAGE: " to the beginning of the base64 encoded message
append: "\n" # appends a new line to the end of the message
payload:
type: raw
publish:
enabled: false
input:
type: hex
content: AB23F6E983
trigger:
- type: periodic # default trigger: periodic with no count (indefinitely) and interval 1 second
- topic: mqtli/protobuf
subscription:
enabled: true
qos: 1
outputs:
- format:
type: yaml
- format:
type: json
- format:
type: text
- format:
type: hex
- format:
type: base64
- format:
type: raw
- format:
type: base64
target:
type: file
path: "log.txt"
overwrite: false
prepend: "MESSAGE: " # prepends the string "MESSAGE: " to the beginning of the base64 encoded message
append: "\n" # appends a new line to the end of the message
payload:
type: protobuf
definition: "test/data/message.proto"
message: "Response" # Response is the name of the protobuf message
publish:
enabled: true
input:
type: hex
content: 082d12080a066b696e646f66180222024142 # this must be a valid protobuf message according to the payload format (encoded as hex)
trigger:
- type: periodic # default trigger: periodic with no count (indefinitely) and interval 1 second
- topic: mqtli/json
subscription:
enabled: true
qos: 1
outputs:
- format:
type: yaml
- format:
type: base64
target:
type: topic
topic: mqtli/json/output
# these filters extract the field "name" of all array entries with key "array",
# convert it to text and change the case to upper case.
# Note that in this example, two messages are generated and sent to the output topic,
# one message for each name.
filters:
- type: extract_json
jsonpath: $.array[*].name
- type: to_upper
payload:
type: json
publish:
enabled: true
input:
type: json
content: |
{
"array": [
"name": "John",
"age": 32
], [
"name": "Sandy",
"age": 31
]
}
trigger:
- type: periodic # default trigger: periodic with no count (indefinitely) and interval 1 second
- topic: mqtli/text
subscription:
enabled: true
qos: 1
outputs:
- format:
type: text
# these filters take the received payload, converts it to json,
# extracts the name and sets it to all uppercase
filters:
- type: extract_json
jsonpath: $.name
- type: to_upper
payload:
type: text
publish:
enabled: true
input:
type: text
content: |
{
"array": [
"name": "John",
"age": 32
], [
"name": "Sandy",
"age": 31
]
}
# these filters convert the text input to json and extract
# the first array element before sending it onto the topic
filters:
- type: extract_json
jsonpath: $.array[0]
trigger:
- type: periodic # default trigger: periodic with no count (indefinitely) and interval 1 second