Fixed Width Parser
The FIXED_WIDTH parser plugin is used to take in a string and extract the fields when they are originally sized by column width.
Parameters
field_widths: the length of each field, separated by commas. For example, ‘14,4,8’
remove_padding: OPTIONAL. Fields are often padded. This property is used to strip out the padding, for example spaces. There is no default value.
skip_fields: OPTIONAL, it ignores certain incoming fields. For example, let’s say you stream providers records with 5 fields, but your RioDB stream only cares about 3, then you can instruct which 2 fields from the original record are not wanted and should be skipped.
Syntax
PARSER fixed_width (
field_widths '<integers separated by comma>'
remove_padding '<a single char>'
skip_fields '<comma-separated integers>'
)
Example
To parse records like “session_id,request_type,reresponse_time”
02938470293847POST0.32
20938472304872GET 0.12
2-304870238470POST0.42
You can use
PARSER fixed_width (
field_widths '8,4,8'
remove_padding ' '
)
If you don’t care about the first two fields:
PARSER fixed_width (
field_widths '8,4,8'
remove_padding ' '
skip_fields '1,2'
)