Skip Functions
Overview
Skip functions are used in Feature Extraction and allow moving the pointer/imaginary cursor to a position of interest in the log line.
skip
This function is used to skip a particular word in the log line.
skip("wordtoskip") where wordtoskip
is the word to be skipped. Note that double quotes are required.
Consider the Log line Update-mapping for Metric-7kjdgp3g hosted from master-2
Using skip(“for”), the pointer will look for the word for
and move the imaginary cursor after the word for
Initial pointer position
|
Update-mapping for Metric-7kjdgp3g hosted from master-2
Final pointer position
Update-mapping for |
Metric-7kjdgp3g hosted from master-2
skipword
This function is used to skip a given number of words. This function assumes each word is separated by a single space
. The pointer position moves to the end of the space
after the Nth word.
skipword("N") where N
is the number of words to be skipped.
Consider the Log line Update-mapping for Metric-7kjdgp3g hosted from master-2. Using skipword(“5”), the pointer will skip five words. In this example, the pointer or imaginary cursor is denoted by |
.
Initial pointer position
|
Update-mapping for Metric-7kjdgp3g hosted from master-2
Final pointer position
Update-mapping for Metric-7kjdgp3g hosted from |
master-2
skipchar
This function is used to skip N number of characters. The pointer position is always after the Nth skipped character.
skipchar(N) where N
is the number of characters to skip.
Consider the Log line "This is an example list."
Using skipchar(7)
moves the pointer 5 characters to the right.
In this example, the pointer or imaginary cursor is denoted by |
.
Initial pointer position
|
This is an example list.
Final pointer position
This is|
an example list.
skipuntil
This function is used to skip until the string as specified is found. It skips only until the first occurrence of the string.
skipuntil("wordtoskip",includeword)
wordToSkip
is a string and denotes the word until which the cursor skips.
- If wordToSkip is specified as
$numeric$
, everything until the first occurrence of a number is skipped. - If wordToSkip is specified as
$special$
, everything until the first occurrence of a special character is skipped.
includeWord
is an integer which denotes whether to include the wordtoskip
Use 0
to exclude and 1
to include the wordtoskip
- The pointer position is before the
wordToSkip
ifincludeWord
is0
. - The pointer position is after the
wordToSkip
ifincludeWord
is1
.
Consider the Log line Running full sweep for node-116
Using skipuntil(“for”, 0) skips the pointer position to the beginning of the the first occurrence of the word for
In this example, the pointer or imaginary cursor is denoted by |
.
Initial pointer position
|
Running full sweep for node-116
Final pointer position
Running full sweep |
for node-116
The remaining log line after skipping will be for node-116