LogLlama

sed Syntax

Introduction

For some actions, LogLlama follows the syntax of the Linux command-line utility sed. For an overview of sed, see for example A Visual Guide To Sed.

In LogLlama, sed syntax takes the following form:

sed [address] command [arguments]

If the address is a regular expression, then its first character is treated as a delimiter and must be used to end the expression:

/abc/
|abc|

Within a regular expression, the backslash character is used to escape both the delimiter and any other backslash. Do not use a backslash as your deliieter.

/abc\/def\\ghi|jkl/       => abc/def\ghi|jkl
|abc/def\\ghi\|jlk//      => abc/def/ghi|jkl
\abc\                     => NO

Commands

The following commands are implemented:

Command Description
+ Un-hide any matching lines.
- Hide any matching lines.
~ Hilight matches in any matching lines.
s/regex/text/[g] replace regex with text.
d Delete any matching lines, and renumber lines.
a text Append text as new lines after any matching lines, and renumber lines.
i text Insert text as new lines before any matching lines, and renumber lines.
c text Change the text of any matching lines to the given text.

The filtering and hilighting commands (+, -, and ~) work the same way as their regular counterparts, but the sed-style addressing option gives new flexibility for hiding and unhiding lines. For example, if you have identified line 1000 as significant and want to ensure the 100 previous lines are visible so you can see what let up to the significant event, you could write sed 900-1000 +.

The replace command s supports a single replacement (g not specified) or global replacement (g specified). No other flags are supported. References in the replacement text are not supported either.

Differences from sed