<commit_before># AdvancedTail
A lightweight .NET Windows program to follow changing text files and provides advanced filtering and formatting.

* Tail text-based files or Windows Event Logs in a user-friendly GUI
* Advanced filtering using regular expressions
* Advanced line trimming using regular expressions to enhance readability
* Line highlighting
* Lightweight/small footprint
* Demo mode to show how it works
* Simple text search
* Can run multiple instances to tail several logs at once

### System Requirements
* Windows 7 SP1 or higher
* .NET 4.6 or higher

### Install
1. Download the release executable from the [/AdvancedTail/Tail/bin/Release Folder](https://github.com/gsirhc/AdvancedTail/raw/master/Tail/bin/Release/Tail.exe)
2. Place anywhere on your system and run.

### Downloading Source
You are of course welcome to download the source.  AdvancedTail source was written using 
Visual Studio 2015 Community Edition.  With Visual Studio installed, simply open the Tail.sln file.
There are a few Nuget packages to download which Visual Studio should do automatically.

### Features in Detail

![Main Form](https://raw.githubusercontent.com/gsirhc/AdvancedTail/master/screenshots/main4.png)

#### Filtering
AdvancedTail provides a filtering engine to remove lines from the displayed text using regular expressions.
Though regex is a scary/complex search language, it easily provides all the filtering capabilties
you'd expect and the expressions can be simple (see below for an example).


##### How does filtering work?
AdvancedTail uses a given regular expression and tests it against each line of the file.  If the line is a match
it will be displayed.  Any line that does not match will be hidden.

Lets say you have the following log file:

```
[7:10:01pm] This is a test log line
[7:10:02pm] We want to see this line because it rocks
[7:10:03pm] But not this line
[7:10:04pm] And we want to see this line because it rules
```

To filter out the lines you don't want to see, create a filter like this:

``` "to see" ```

AdvancedTail will display:

```
[7:10:02pm] We want to see this line because it rocks
[7:10:04pm] And we want to see this line because it rules
```

You can also OR filters like ```rules|rocks``` to display the same lines.

##### Predefined Filters
Predefined filters are available in the Filter Configuration form.  There you can find many options
for filtering, trimming and highlighting tailed files.  Simple click the Configuration to populate
the applicable fields, adjust as needed and click Ok.

You can also save configurations to apply to other files by clicking the Save button.  Your saved
configuration will be displayed in the "Saved Filters" group.

#### Trimming
AdvancedTail also provides a mechanism to trim lines based on regular expressions.  This is useful
if you want to remove common text from the lines to make them easier to read.

##### How does trimming work?

The trimming feature provides two types of trims:
* Trim To: Trims from the beginning of the line to the first character of the match
* Trim From: Trims from the first character of the match to the end.
* Trim Middle: Requires the regular expression to yield at least 2 groups on a match.  Trims from the start of the first group to the end of the last group.

NOTE: If using "To" and "From" together, trims the "To" first, then applies the "From" to the remaining text.

Lets say you this log file:

```
[7:10:02pm] We like this line because it rocks and rolls
[7:10:04pm] And we like this line because it rules and rolls
```

To trim off the common parts of the lines:

``` 
trim to: "it"
trim from: "and rolls"
```

AdvancedTail will display:

```
it rocks
it rules
```

Or you can be more specific with the "To":  ```trim to: "it rules|it rocks"```

Now lets say you want to remove the "like this line because" portion of the lines but keep the time:

```
[7:10:02pm] We like this line because it rocks and rolls
[7:10:04pm] And we like this line because it rules and rolls
```

Here you'd use Trim Middle (note the case-insensite modifier to capture 'We' and 'we'):

``` 
trim middle: "(?i)((We).*(because+\s))"
```

AdvancedTail will display:

```
[7:10:02pm] it rocks and rolls
[7:10:04pm] And it rules and rolls
```

#### Line Highlighting
AdvanvedTail provides separate regular expressions to define how lines are
highlighted in the display.  You can define up to 6 color
expressions red, yellow, green, blue, gray and subtle (grayed text).  Additionally, highlighting can be toggled on and off
in real time.

#### Windows Event Logs
AdvancedTail allows you to tail the most commonly used Windows Event Logs by converting them to
text and displaying as though the log was a file.  This allows you to apply filters, trimming and
highlighting.  The logs will update in real time as events are added.

Since AdvancedTail formats the event logs, predefined filter configurations are provided to
help you filter, trim and highlight the events.<commit_msg>Fix small issues<commit_after># AdvancedTail
A lightweight .NET Windows program to follow changing text files and provides advanced filtering and formatting.

* Tail text-based files or Windows Event Logs in a user-friendly GUI
* Advanced filtering using regular expressions
* Advanced line trimming using regular expressions to enhance readability
* Line highlighting
* Lightweight/small footprint
* Demo mode to show how it works
* Simple text search
* Can run multiple instances to tail several logs at once

### System Requirements
* Windows 7 SP1 or higher
* .NET 4.6 or higher

### Install
1. Download the release executable from the [/AdvancedTail/Tail/bin/Release Folder](https://github.com/gsirhc/AdvancedTail/raw/master/Tail/bin/Release/Tail.exe)
2. Place anywhere on your system and run.

### Downloading Source
You are of course welcome to download the source.  AdvancedTail source was written using 
Visual Studio 2015 Community Edition.  With Visual Studio installed, simply open the Tail.sln file.
There are a few Nuget packages to download which Visual Studio should do automatically.

### Features in Detail

![Main Form](https://raw.githubusercontent.com/gsirhc/AdvancedTail/master/screenshots/main4.png)

#### Filtering
AdvancedTail provides a filtering engine to remove lines from the displayed text using regular expressions.
Though regex is a scary/complex search language, it easily provides all the filtering capabilties
you'd expect and the expressions can be simple (see below for an example).


##### How does filtering work?
AdvancedTail uses a given regular expression and tests it against each line of the file.  If the line is a match
it will be displayed.  Any line that does not match will be hidden.

Lets say you have the following log file:

```
[7:10:01pm] This is a test log line
[7:10:02pm] We want to see this line because it rocks
[7:10:03pm] But not this line
[7:10:04pm] And we want to see this line because it rules
```

To filter out the lines you don't want to see, create a filter like this:

``` "to see" ```

AdvancedTail will display:

```
[7:10:02pm] We want to see this line because it rocks
[7:10:04pm] And we want to see this line because it rules
```

You can also OR filters like ```rules|rocks``` to display the same lines.

##### Predefined Filters
Predefined filters are available in the Filter Configuration form.  There you can find many options
for filtering, trimming and highlighting tailed files.  Simple click the Configuration to populate
the applicable fields, adjust as needed and click Ok.

You can also save configurations to apply to other files by clicking the Save button.  Your saved
configuration will be displayed in the "Saved Filters" group.

#### Trimming
AdvancedTail also provides a mechanism to trim lines based on regular expressions.  This is useful
if you want to remove common text from the lines to make them easier to read.

##### How does trimming work?

The trimming feature provides two types of trims:
* Trim To: Trims from the beginning of the line to the first character of the match
* Trim From: Trims from the first character of the match to the end.
* Trim Middle: Requires the regular expression to yield at least 2 groups on a match.  Trims from the start of the first group to the end of the last group.

NOTE: If using "To" and "From" together, trims the "To" first, then applies the "From" to the remaining text.

Lets say you this log file:

```
[7:10:02pm] We like this line because it rocks and rolls
[7:10:04pm] And we like this line because it rules and rolls
```

To trim off the common parts of the lines:

``` 
trim to: "it"
trim from: "and rolls"
```

AdvancedTail will display:

```
it rocks
it rules
```

Or you can be more specific with the "To":  ```trim to: "it rules|it rocks"```

Now lets say you want to remove the "We like this line because" portion of the lines but keep the time:

```
[7:10:02pm] We like this line because it rocks and rolls
[7:10:04pm] And we like this line because it rules and rolls
```

Here you'd use Trim Middle (note the case-insensitive modifier ```(?i)``` to capture 'We' and 'we'):

``` 
trim middle: "(?i)((We).*(because+\s))"
```

AdvancedTail will display:

```
[7:10:02pm] it rocks and rolls
[7:10:04pm] And it rules and rolls
```

#### Line Highlighting
AdvanvedTail provides separate regular expressions to define how lines are
highlighted in the display.  You can define up to 6 color
expressions red, yellow, green, blue, gray and subtle (grayed text).  Additionally, highlighting can be toggled on and off
in real time.

#### Windows Event Logs
AdvancedTail allows you to tail the most commonly used Windows Event Logs by converting them to
text and displaying the logs like a file.  This allows you to apply filters, trimming and
highlighting.  The logs will update in real time as events are added.

Since AdvancedTail formats the event logs, predefined filter configurations are provided to
help you filter, trim and highlight the events.
{'fraction_non_alphanumeric': 0.06897587346080689, 'fraction_numerical': 0.014616077685453999, 'mean_word_length': 4.414634146341464, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '437077', 'n_tokens_mistral': 2847, 'n_tokens_neox': 2665, 'n_words': 1513}