- 5 minutes to read

Flat File Fixed Width Search Field Expression Plugin

The Flat file Fixed width plugin extracts Search Field values from the Message Body of a Log Event by character position: on each line it reads a set number of characters from a zero-based start position. Use it for fixed-width records from mainframe, AS/400, and other legacy systems, where fields have no delimiter.

  • ✅ Extracts by Start position on line and Length, no delimiter needed
  • ✅ Limits extraction to chosen rows with Rows to include and Rows to skip

Flat file Fixed width returns the order numbers 10001 and 10002 from a legacy order export, animated walkthrough (7.12)
Animated walkthrough: Start position on line 3 and Length 5 on a logged fixed-width order export return 10001 and 10002; 10001 is on two lines and is returned once.

When to use it

Your data Use
Fixed-width records in the Message Body, value at a known character position Flat file Fixed width (this plugin)
CSV or other delimited text, value in a known column Flat file CSV
Text where the value's position varies but its pattern is known RegEx
Content you need to transform or combine, or that sits in a context property Formula

For all plugins side by side, see Choose a plugin.

Expression syntax

Select Flat file Fixed width in the Type list, then fill in the fields of the Expressions group:

Type list filtered on flat, showing Flat file CSV and Flat file Fixed width (7.12)
The Flat file Fixed width plugin in the Type list.

Field What goes in it
Start position on line The zero-based character position where the value starts: 0 is the first character on the line.
Length The number of characters to read. Position 4 with length 3 reads characters 4 to 6.
Start position from line end Shown when Start position on line is empty. The value starts this many characters before the line end.
To position from line end Shown when Length is empty. The value ends this many characters before the line end.
Row number to include Optional. A single row to extract from. Rows are numbered from 1.
Row number to skip Optional. A single row to leave out, such as a header row 1.
Rows to include Optional. Click Add and enter From line and To line for a range of rows to extract from. Both ends are included. Leave one end empty for an open range: only From line means that line to the end, only To line means the start to that line.
Rows to skip Optional. Click Add and enter From line and To line for a range of rows to leave out, the same way.
  • Character positions start at 0; row numbers start at 1.
  • A row that matches both an include and a skip setting is skipped.
  • Each value is trimmed of leading and trailing white space, so padding never ends up in the Search Field; a value that is blank after trimming is dropped.
  • A line too short for the position and length is skipped without an error.
  • The plugin counts characters only, so any separator characters in the line are counted like any other character.
  • One expression can hold several positions: click the last Add under the row settings to add another Start position on line and Length. Each position adds its values.
  • To read a field at the end of each record, use Start position from line end. In Example 2, Start position from line end 8 with Length 8 returns the dates 20261001, 20261002, and 20261003.

The plugin returns each unique value once (see How expressions run). Configure the plugin in Add or manage Search Field and check the result, including which rows your row settings select, with Test Your Expression. When nothing matches, the test reports Processed with warning: The Expression yields no result instead of values:

Test Expression result: Processed with warning, The Expression yields no result (7.12)
The test result when the expression finds no value.

Row Selection

Each Add button opens a From line / To line pair; add one pair per range.

Rows to include with its Add button (7.12)
Rows to include, before a range is added.

Rows to include with From line and To line fields (7.12)
A Rows to include range: From line and To line.

Rows to skip with its Add button (7.12)
Rows to skip, before a range is added.

Rows to skip with From line and To line fields (7.12)
A Rows to skip range: From line and To line.

Examples

Example 1: Extract order numbers at position 4

Input

ORD|101|ExampleCompany1|456|Company Name ACME |Dieselgate valley 1|123 45|Flameburg|
ORD|102|ExampleCompany2|789|Company Name MECA |Radiator Spring 420|543 21|Apocalypsenburg|

Expression

Start position on line = 4
Length = 3

Result

101
102

Positions 0 to 3 hold ORD|, so position 4 is where the order number starts. The | characters aren't delimiters for this plugin; they are counted as characters.

Test Expression tab with Type Flat file Fixed width, Start position on line 4 and Length 3; the Result lists 101 and 102 from the two ORD lines in the Message Body (7.12)
Start position 4 with Length 3 returns the order numbers 101 and 102.

Example 2: Extract order numbers from padded fixed-width records

Input

ORD10001ACME          20261001
ORD10002NORTHWIND     20261002
ORD10001ACME          20261003

Each record holds the record type (positions 0–2), the order number (3–7), the customer name padded with spaces (8–21), and the date (22–29).

Expression

Start position on line = 3
Length = 5

Result

10001
10002

Order 10001 appears on two lines but is returned once.

Test Expression tab with Type Flat file Fixed width, Start position on line 3 and Length 5; the Result lists 10001 and 10002 from three fixed-width lines (7.12)
Start position 3, Length 5: the order numbers, with the duplicate collapsed.

Example 3: Extract padded customer names

Same input as Example 2.

Expression

Start position on line = 8
Length = 14

Result

ACME
NORTHWIND

The 14 characters include the padding spaces, which the plugin trims, so users search for ACME, not ACME followed by ten spaces.

Test Expression tab with Type Flat file Fixed width, Start position on line 8 and Length 14; the Result lists ACME and NORTHWIND without the padding spaces (7.12)
Start position 8, Length 14: the padded names come back trimmed.

Next Steps