- 0 minutes to read

Flat File Fixed Width search field expression type plugin

Use this plugin to extract values from the body part of small messages with a fixed width content.

The Nodinite Flat File Fixed Width Search Field Expression Type plugin can be used to get one or more unique values from payload (Body) of Log Events (business transactions).

  • Flat files with fixed width delimiter

A Logged message comes from a Log Event that is part of the Logging feature of Nodinite, and the Search Fields are further used within self-service enabled Log Views for your business.

Quick example

Let's get you started with the following simple demonstration example valid for this search field plugin. For other and more advanced examples please scroll down on this page to the Examples section.

Input Expression Result
ORD|101|ExampleCompany1|456|Company Name ACME |...
ORD|102|ExampleCompany2|789|Company Name MECA |...
Start position on line = 4
Length = 3
101
102
Flat file Data Flat File Fixed Width configuration Unique values

Features

  • Extract single or multiple unique values from messages (payload)
  • Use the Flat File Fixed Width configuration options to match data
  • Starting position (positive integer)
  • Length (positive integer)
  • Row number to include (single row option)
  • Row number to exclude (single row option)
  • Row numbers to include (start/stop)

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

  • Row numbers to exclude (start/stop)
    Exclude rows option
    click the Add button to enter which rows to exclude

RemoveRowsOption
Enter start and stop rows to exclude

Important

This plugin loads the entire message into RAM, so make sure to apply this extraction method on smaller messages only.

  • Flat File CSV - Content is delimited by the specified character.
  • Formula - Advanced options using nested expressions.

How to use

To extract values from flat files (logged messages) with fixed width you must first configure the Search Field, in this example case; The Order Id:

Once a Search Field is configured, values are extracted either during normal processing or from user initiated re-index operations. Extracted values are persisted and stored for as long as the days to keep events property on the Message Type is configured.

Test Expression

You can test an expression when configuring a Search Field in the 'Test Expression' tab

  1. Enter an appropriate payload in the 'Message Body' tab
  2. Select the 'Flat File Fixed Width' expression type plugin
    Select Plugin
    Here's an exmple selecting the 'Flat File Fixed Width' expression type plugin.
  3. Enter valid configuration (You can also click on elements/attributes to get a suggestion)
  • Row number to include (single row option) - Leave empty for all rows
  • Row number to exclude (single row option) - Leave empty to not exclude any rows
  • Row numbers to include (start/stop) - Add as needed
  • Row numbers to exclude (start/stop) - Add as needed 4. Review result/output, rewrite the code in step 3 until you get the data you seek

The actual result (values) are extracted by the Logging Service and then presented together with the evaluated processing state and the number of unique matches.

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

If the expression is either invalid or does not match any data, then the following output is presented:
No Result
Here's an example with an invalid expression, which yields no result.

Examples

graph LR subgraph "Search Fields" sf(fal:fa-magnifying-glass-plus Order Number) end subgraph "Search Field Expressions" sfe(fal:fa-flask Flat File Fixed Width plugin) end subgraph "MessageTypes" mt1(fal:fa-file Orders) end sf --- sfe sfe ---|Expression configuration| mt1

Example sample #1: Flat File (| Delimited)

To extract the 2nd field, for example Order ID from the following pipe (|) delimited flat file you can use Start position on line=4 and Length=3. This configuration yields the values 101 and 102.

Message Body

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|

Flat File Fixed Width configuration

Start position on line = 4
Length = 3

Flat FileExample #2
Example extract multiple order ids from flat file with fixed width


Next Step

How to Add or manage Search Fields
How to Add or manage Log Views

Expression Type Plugins are used in Search Fields
What are Search Fields?
What are Search Field Expressions?
What are Message Types?
What are Log Views?