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 |
---|---|---|
|
|
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)
click the Add button to enter which rows to include
Enter start and stop rows to keep
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.
Other Flat File related plugins
- 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:
- Select expression type plugin.
- Enter an expression.
- Finalize remaining steps including selection of Message Types and optional re-index operation (Add or manage Search Field).
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
- Enter an appropriate payload in the 'Message Body' tab
- Select the 'Flat File Fixed Width' expression type plugin
Here's an exmple selecting the 'Flat File Fixed Width' expression type plugin. - 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.
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:
Here's an example with an invalid expression, which yields no result.
Examples
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
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
Related
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?