PPA Tools: Text
Summary
This module contains actions used to process & search text.
Actions
ppa_tools.text.
extract_values
Find & extract one or more named values from some text using regular expressions.
This action supports both single & multiple lines of text.
Minimum Plugin Version: 1.3.0
Regular Expressions
The following regex cheat-sheet & visualiser can help you get started with expressions.
Input
-
values: a single or list of NamedGroup dictionaries
-
text: the text to find & extract values from
Output
A list of dictionaries containing any matches found in the text.
Each dictionary's key is the name
of the NamedGroup, & its value is the matching text.
Example
Finding all usernames from a failed SSH logon message & saving the matches as usernames
.
1 2 3 4 5 6 7 8 |
|
The contents of the new usernames
variable will be:
1 2 |
|
ppa_tools.text.
split_lines
Split a string into a list of strings based on new lines.
Minimum Plugin Version: 3.3.0
Input
- text: the string to split
Output
A list of strings.
Example
Splitting on one or more new line characters:
- ppa_tools.text.split_lines:
text: >
Line one
Line two
Line three
save: split_output
The output will be:
- Line one
- Line two
- Line three