@@ -96,6 +96,7 @@ An event formatter is defined as a set of attributes:
96
96
97
97
* "data_type"; required event data type.
98
98
* "boolean_helpers"; optional boolean helpers.
99
+ * "custom_helpers"; optional custom helpers.
99
100
* "enumeration_helpers"; optional enumeration helpers.
100
101
* "message"; required formatter message string, for a basic type, or list of messages string pieces, for a conditional type.
101
102
* "separator"; optional conditional message string piece separator, the default is a single space.
@@ -143,14 +144,42 @@ short_message:
143
144
- '{path}'
144
145
```
145
146
146
- boolean helpers are defined as a set of attributes:
147
+ Boolean helpers are defined as a set of attributes:
147
148
148
- * "input_attribute"; required name of the attribute which the value that needs to be mapped is read from.
149
- * "output_attribute"; required name of the attribute which the mapped value is written to.
149
+ * "input_attribute"; required name of the attribute which the value is read from.
150
+ * "output_attribute"; required name of the attribute which the formatted value is written to.
150
151
* "default_value"; optional default value if there is no corresponding mapping in "values".
151
152
* "value_if_false"; optional output value if the boolean input value is False.
152
153
* "value_if_true"; optional output value if the boolean input value is True.
153
154
155
+ #### Custom helpers
156
+
157
+ Custom helpers can be defined to map a value of an event attribute to custom
158
+ formatting code.
159
+
160
+ ```
161
+ type: 'conditional'
162
+ data_type: 'fs:stat:ntfs'
163
+ custom_helpers:
164
+ - identifier: 'ntfs_file_reference'
165
+ output_attribute: 'file_reference'
166
+ message:
167
+ - '{display_name}'
168
+ - 'File reference: {file_reference}'
169
+ short_message:
170
+ - '{filename}'
171
+ - '{file_reference}'
172
+ ```
173
+
174
+ Here ` ntfs_file_reference ` references the ` NTFSFileReferenceFormatterHelper ` ,
175
+ which is defined in ` plaso/formatters/file_system.py ` .
176
+
177
+ Custom helpers are defined as a set of attributes:
178
+
179
+ * "identifier"; required identifier of the custom format helper.
180
+ * "input_attribute"; optional name of the attribute which the value is read from.
181
+ * "output_attribute"; optional name of the attribute which the formatted value is written to.
182
+
154
183
#### Enumeration helpers
155
184
156
185
Enumeration helpers can be defined to map a value of an event attribute to
@@ -186,10 +215,10 @@ short_message:
186
215
- '{description}'
187
216
```
188
217
189
- enumeration helpers are defined as a set of attributes:
218
+ Enumeration helpers are defined as a set of attributes:
190
219
191
- * "input_attribute"; required name of the attribute which the value that needs to be mapped is read from.
192
- * "output_attribute"; required name of the attribute which the mapped value is written to.
220
+ * "input_attribute"; required name of the attribute which the value is read from.
221
+ * "output_attribute"; required name of the attribute which the formatted value is written to.
193
222
* "default_value"; optional default value if there is no corresponding mapping in "values".
194
223
* "values"; required value mappings, contains key value pairs.
195
224
@@ -241,10 +270,17 @@ short_message:
241
270
- '{flag_values}'
242
271
```
243
272
273
+ Flags helpers are defined as a set of attributes:
274
+
275
+ * "input_attribute"; required name of the attribute which the value is read from.
276
+ * "output_attribute"; required name of the attribute which the formatted value is written to.
277
+ * "values"; required value mappings, contains key value pairs.
278
+
244
279
#### Change log
245
280
246
281
* 20200227 Added support for formatter configuration files.
247
282
* 20200822 Added support for enumeration helpers.
248
283
* 20200904 Added support for flags helpers.
249
284
* 20200916 Removed source types from formatters.
250
285
* 20201220 Added support for boolean helpers.
286
+ * 20201227 Added support for custom helpers.
0 commit comments