- 4 minutes to read

Flat File Fixed Width Search Field Expression Plugin

Easily extract unique values from fixed-width messages using the Flat File Fixed Width Search Field Expression Plugin. This page shows you how to configure, test, and use this plugin with clear input, configuration, and result examples.

✅ Extract single or multiple unique values from fixed-width messages ✅ Flexible configuration for start position, length, and row selection ✅ Works with legacy mainframe formats and COBOL layouts ✅ Designed for high performance and self-service log views

🎯 Design Note: Perfect for legacy mainframe systems, COBOL files, and fixed-position data formats!


What does the Flat File Fixed Width plugin do?

The Flat File Fixed Width plugin lets you extract one or more unique values from the payload (Body) of Log Events. Use it to process messages where each field has a fixed width and position, making it easy to target specific data without delimiters.

Key Features:

  • Process flat files with fixed-width fields
  • Extract data by position and length
  • Target specific rows or ranges for extraction
  • Include or exclude specific row numbers
  • Ideal for mainframe and COBOL-based systems

Use Case: Extract data from mainframe reports, COBOL files, AS/400 outputs, or legacy fixed-position formats.


How it works

The Flat File Fixed Width plugin processes messages in three steps:

  1. Input: The fixed-width message payload
  2. Configuration: Start position, length, and row selection
  3. Result: Unique value(s) extracted from specified positions
graph LR A["Input: Fixed-Width Payload"] --> B["Configuration: Position + Length"] B --> C["Result: Unique Values"]

The plugin extracts characters from specific positions based on fixed-width field definitions.


Example

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|

Configuration:

Start position on line = 4
Length = 3

Result:

101
102

Tip

Positions are zero-based. Position 4 with length 3 extracts characters 4-6 from each line.

Flat File Example Example: Extract order IDs from a fixed-width flat file.


Configuration options

Option Description Example
Start position Zero-based starting character position 4, 10, 25
Length Number of characters to extract 3, 10, 20
Include rows Specific rows to include (single or range) 1, 1-5, 10-20
Exclude rows Specific rows to exclude (single or range) 1, 1-3

How to use the Flat File Fixed Width plugin

  1. Open the Search Field Wizard from a Log View and either create a new Search Field or edit an existing one
  2. Choose the Flat File Fixed Width plugin from the Expression Type dropdown
  3. Configure the plugin settings:
    • Start position on line (zero-based character position)
    • Length (number of characters to extract)
    • Row number(s) to include (optional)
    • Row number(s) to exclude (optional)
  4. Select the Message Type(s) to apply the field
  5. Save the configuration
  6. Re-index existing data (optional)
  7. The extracted data is now available in your Log Views!

Select Flat File Fixed Width plugin Example: Selecting the Flat File Fixed Width plugin in the Search Field configuration.

Row Selection Options:

Add Rows Button Click the Add button to enter which rows to include

Add Start and Stop Rows Option Enter start and stop rows to keep

Exclude rows option Click the Add button to enter which rows to exclude

RemoveRowsOption Enter start and stop rows to exclude

Tip

Extracted values are stored for as long as the Message Type retention is configured.


Testing your expression

You can test your configuration in the Test Expression tab before saving:

  1. Enter a sample payload in the Message Body tab
  2. Select the Flat File Fixed Width plugin
  3. Enter your configuration settings
  4. Review the output and adjust as needed

Successful Match: ✅ Shows matched values and extraction count.

Test Expression Example: Valid expression with state output, unique values, and total count.

No Match: ❌ Occurs when the position/length is invalid or rows don't exist.

No Result Example: Invalid configuration yielding no result.


Important considerations

Performance:

  • This plugin loads the entire message into memory
  • Use only for small to medium payloads to avoid performance issues

Alternatives for other formats:


  • Flat File CSV - Extract from delimited files (CSV, TSV)
  • Formula - Create expressions with conditional logic
  • RegEx - Pattern-based extraction

Next steps