Pad Lines

Description

This operation allows you to add padding characters to the beginning or end of each line of text. This operation is useful for formatting text, aligning data, or preparing output for specific requirements such as indentation or prefixing/suffixing lines.


Data types

These are the input/output expected data types for this operation:

Input data

- Input text to be padded. The operation processes multiline text where each line is treated as a separate unit.

Output data

- Each line in the input will be padded based on the selected options.


Parameters

These are the parameters you need to configure to use this operation (mandatory parameters are marked with a *):

Pad position*

Determines where the padding is applied to each line of text. This parameter allows for flexible control over how padding is added, enabling you to customize the output to meet specific formatting requirements. Enter one of the following:

  • Start - Applies the padding at the right of the strings.

  • End - Applies the padding at the left of the strings.

Pad length*

Enter the total number of characters you want your padding to have in each line. Padding will be filled with the characters set in the Characters parameter until reaching the required length.

Characters

This allows you to specify which character(s) will be used for padding. This is the string that will be added to the beginning or end of each line to achieve the desired padding effect, as defined by the Pad position and Pad length parameters.


Example

Suppose you want to add padding to a series of events:

  1. In your Pipeline, open the required Action configuration and select the input Field.

  2. In the Operation field, choose Pad lines.

  3. Set Pad position to Start.

  4. Set Pad length to 7.

  5. Set Characters to >>>

  6. Give your Output field a name and click Save. The strings in your input field will be modified with the specified padding.

For example, the following lines:

Apple
Banana
Cherry

will be transformed into:

>>> >>>Apple
>>> >>>Banana
>>> >>>Cherry

You can try out operations with specific values using the Input field above the operation. You can enter the value in the example above and check the result in the Output field.

Last updated

Was this helpful?