---
title: Monitor Content-Based Log Files with Nodinite Log File Parser
description: Monitor content-based log files with Nodinite Log File Parser. Detect patterns, errors, and events in real-time using RegEx expressions. Automate alerts and gain operational visibility across text-based logs.
---

:ReleaseNotes(https://portal.nodinite.com/marketplace/24):

# :fa-search: Monitoring Content Files

**Technical guide to content-based pattern detection monitoring—configure [RegEx][] patterns, negative filtering, threshold evaluation, and alert states for text-based log files.**

## What is Content-Based Monitoring?

Content-based monitoring evaluates each log line independently using regular expression pattern matching. When a line matches the configured pattern (and does not match negative exclusion patterns), the [Log File Parser Monitoring Agent][] records a detection event and evaluates threshold rules to determine resource state.

### Pattern Detection Flow

```mermaid
flowchart TD
    Start([File Scanning<br/>Every 60 seconds]) --> FileFilter{Apply Time<br/>Options Filter}
    FileFilter -->|Modified/Created<br/>After Clear Date| IncludeFiles[Select Matching Files]
    FileFilter -->|Evaluate All| IncludeFiles
    IncludeFiles --> FileLoop{More Files<br/>to Scan?}
    FileLoop -->|Yes| ReadNew[Read New Log Lines<br/>from File]
    FileLoop -->|No| CheckState{Any Matches<br/>Found?}
    ReadNew --> LineTest{Match Positive<br/>Pattern?}
    LineTest -->|No Match| NextLine[Continue to Next Line]
    LineTest -->|Match| NegCheck{Match Negative<br/>Pattern?}
    NegCheck -->|Yes - Exclude| NextLine
    NegCheck -->|No - Include| ErrorState([State: Error<br/>Alert Triggered])
    NextLine --> MoreLines{More Lines<br/>in File?}
    MoreLines -->|Yes| LineTest
    MoreLines -->|No| FileLoop
    ErrorState --> MoreLines
    CheckState -->|Yes| MaintainError([State: Error<br/>Remains])
    CheckState -->|No| OKState([State: OK<br/>No Alert])
    MaintainError --> Wait[Wait for Next Scan]
    OKState --> Wait
    Wait --> Start
    style Start fill:#e3f2fd
    style FileFilter fill:#e1bee7
    style IncludeFiles fill:#fff9c4
    style ReadNew fill:#fff9c4
    style ErrorState fill:#f44336,color:#fff
    style MaintainError fill:#f44336,color:#fff
    style OKState fill:#4caf50,color:#fff
    style NegCheck fill:#e1bee7
```

**Key mechanism:** Files are filtered by time options before scanning. Each matched line in any file immediately triggers Error state—spans multiple log files, no counting, no thresholds.

## When to Use This Monitoring Type

Use content-based monitoring for **independent event detection** scenarios:

* :fa-circle-exclamation: **Error detection** - Match "ERROR", "EXCEPTION", "FATAL" keywords or specific error codes
* :fa-shield-halved: **Security events** - Detect authentication failures, SQL injection attempts, privilege escalation
* :fa-gauge: **Performance patterns** - Identify slow queries, timeout events, resource exhaustion warnings
* :fa-briefcase: **Business events** - Track specific transaction outcomes, user actions, compliance events

For **transaction sequences** requiring start/end correlation, use [Monitoring Correlated Events][] instead.

>[!NOTE]
>For benefits and use cases, see [Log File Parser Monitoring Agent][]. This page focuses on technical monitoring behavior and configuration options.

---

## :fa-cogs: Pattern Detection Mechanics

### Evaluation Flow

1. **File scanning** - Agent reads new log file content at configured interval (default: 60 seconds)
2. **Line-by-line matching** - Each line tested against positive pattern RegEx
3. **Negative pattern filtering** - Matching lines tested against negative pattern RegEx (if configured)
4. **Threshold evaluation** - Detection count compared to warning/error thresholds
5. **State determination** - Resource state updated (OK, Warning, Error) based on threshold rules
6. **Alert generation** - State changes trigger notifications via [Monitor Views][] and [Alarm Plugins][]

### Pattern Matching Rules

* :fa-filter: **Positive patterns** - RegEx expressions that identify events of interest
* :fa-filter-circle-xmark: **Negative patterns (optional)** - RegEx expressions to exclude from positive matches (reduces false positives)
* :fa-font: **Case sensitivity** - Configurable per pattern
* :fa-align-left: **Multi-line matching** - Supported for stack traces and XML/JSON content

**Example configuration with separate negative pattern:**

```regex
Positive Pattern: ERROR|EXCEPTION|FATAL
Negative Pattern: ERROR: Retry attempt \d+/\d+ successful|Connection timeout retrying
Result: Alerts on errors but ignores expected retry messages
```

**Alternative: Negative lookahead within positive pattern:**

```regex
Positive Pattern: ERROR(?!.*(retry|retrying|successful retry|transient))
Negative Pattern: (leave empty)
Result: Matches "ERROR" only if the line does NOT contain retry-related keywords
```

Use negative lookahead when you want a single self-contained pattern, or use separate negative patterns for better maintainability with complex exclusion rules.

### File Selection Criteria

* :fa-asterisk: **Wildcard patterns** - `app*.log`, `error_\d{8}.log` for rotating files
* :fa-clock: **Time-based filtering** - Control which files are included in monitoring based on file timestamps:
  * **Modified/Created after Clear Date Time** - Monitor only files modified or created after specified timestamp
  * **Modified/Created after File time span** - Monitor files within relative time window (e.g., last 24 hours)
  * **Last Modified/Last Created, one file only** - Monitor only the most recently modified or created file
  * **Evaluate all** - Monitor all matching files regardless of timestamp
* :fa-folder-tree: **Recursive scanning** - Include subdirectories (optional)
* :fa-network-wired: **Network paths** - UNC paths (`\\server\share\logs`), SMB shares, local folders

**Time option use cases:**

* :fa-file: **Active logs only** - Use "Modified after Clear Date Time" to ignore archived logs
* :fa-clock-rotate-left: **Recent errors** - Use "Modified after File time span" for rolling 24-hour monitoring
* :fa-file-lines: **Single current file** - Use "Last Modified, one file only" when log rotates hourly but you only care about active file

### Threshold Configuration

Define when detected patterns trigger Warning vs. Error states:

* :fa-hashtag: **Match count thresholds** - Trigger Warning after X matches, Error after Y matches
* :fa-clock: **Time window** - Evaluate matches within sliding time window (e.g., 5 matches in 10 minutes)
* :fa-traffic-light: **State persistence** - State remains until cleared via [Clear Errors][Clear Errors on Managing Content Files] remote action

![Content File Monitoring Overview][1]  
*Example: Content-based log file configurations in a [Monitor View][Monitor Views]*

---

## :fa-sliders-h: Monitor Configuration Options

:Nodinite: presents each **Content File Configuration** as a [Resource][Resources], evaluated in real-time. You can:

* :fa-window-maximize: **Organize by purpose** - Group configurations by [Application][Applications] (Web Server, Database, Payment Processing)
* :fa-tags: **Categorize by type** - All content configurations appear under 'Log File Event' [Category][Categories]
* :fa-server: **Scale monitoring** - Deploy multiple agents across servers for distributed monitoring
* :fa-layer-group: **Apply different rules** - Use multiple configurations for the same files with different patterns

![Content File Categories][2]  
*Example: Content File Configurations organized by [Category][Categories]*

### **Configuration Setup**

* :fa-tag: **Display name** comes from your [Content File Configuration][Configuration - Content File] settings
* :fa-window-maximize: **Application association** links configurations to business applications
* :fa-filter: **Pattern definitions** specify what content triggers alerts
* :fa-clock: **Time options** control which files are included in monitoring

### Resource State Evaluation

Each Content File Configuration ([Resource][Resources]) maintains one of these states based on threshold evaluation:

|State|Condition|Description|  
|---|---|---|  
|🚫 **Unavailable**|File access failed|Agent cannot read files (network issue, permissions, path not found)|  
|❌ **Error**|Threshold exceeded|Pattern matches exceed error threshold (e.g., 10+ matches)|  
|⚠️ **Warning**|Threshold exceeded|Pattern matches exceed warning threshold (e.g., 3+ matches)|  
|✅ **OK**|Below threshold|Pattern matches below warning threshold or no matches detected|  

![Resource States][4]  
*Example: Content file resource showing current monitoring state*

**Override default state evaluation** using the [Expected State][] feature (e.g., expect Warning state during maintenance windows).

---

## :fa-bolt: Remote Actions for Detected Patterns

When patterns are detected or monitoring requires adjustment, perform these [Remote Actions][] from the [Web Client][]:  
    ![Remote Actions][3]  
    *Example: Remote Actions available Content File Configurations.*

* **:fa-edit: [Edit Thresholds][Managing Content Files - Edit Thresholds]** - Adjust warning/error thresholds and pattern definitions without agent restart
* **:fa-circle-info: [Error Report][Managing Content Files - Error Report]** - View matched log entries with file context and download detected content
* **:fa-broom: [Clear Errors][Clear Errors on Managing Content Files]** - Reset resource state after investigating and resolving detected issues
* **:fa-file-alt: [Show Log Files][Managing Content Files - Show Log Files]** - Display monitored files, download log files, manage file-level settings

All actions require appropriate [Role][Roles] permissions and are logged to the [Audit Trail][].

>[!TIP]
>See [Managing Content Files][] for complete action details, including confirmation dialogs, success criteria, and troubleshooting.

---

## :fa-gauge-high: Performance Characteristics

### Scan Interval Configuration

* :fa-clock: **Default interval:** 60 seconds
* :fa-arrows-left-right: **Configurable range:** 10 seconds to 24 hours
* :fa-scale-balanced: **Trade-off:** Lower interval = faster detection, higher CPU usage

### File Position Tracking

* :fa-bookmark: **Persistent state** - Agent remembers last read position per file
* :fa-arrows-rotate: **Restart resilience** - Resumes from last position after agent restart
* :fa-rotate: **Rotation handling** - Detects file rotation (size decrease) and starts from beginning of new file
* :fa-forward: **Incremental reading** - Only processes new content since last scan

### Resource Usage

* :fa-microchip: **CPU:** <5% during active monitoring (200 files)
* :fa-memory: **Memory:** ~100 MB per agent (200 files tracked)
* :fa-network-wired: **Network:** Minimal (read-only file access, no log transfer to [Core Services][])
* :fa-hard-drive: **Disk I/O:** Sequential reads only, leverages OS file cache

---

## :fa-file-code: Supported File Formats

**Any text-based format** where log entries are line-delimited or follow parsable structure:

* :fa-file-lines: **Plain text** - .log, .txt, custom extensions
* :fa-table: **Structured logs** - CSV, TSV, tab-delimited (match specific columns)
* :fa-brackets-curly: **JSON logs** - One JSON object per line (newline-delimited JSON)
* :fa-code: **XML logs** - Multi-line XML matching with RegEx
* :fa-globe: **Web server** - IIS W3C, Apache Combined/Common, Nginx, custom formats

**Timestamp parsing** - Configurable for custom date/time formats

**Binary formats not supported** - Windows .evtx, database proprietary formats require specialized agents

---

## :fa-hand-point-right: Next Steps

**Configuration and setup:**  

:fa-gear: [Configuration - Content File][Configuration - Content File] - Complete setup guide with pattern syntax and threshold rules  
:fa-list-check: [Prerequisites][Prerequisites for Log File Parser Monitoring Agent] - File permissions, network access, agent requirements  
:fa-puzzle-piece: [Install Agent][Install Log File Parser Monitoring Agent] - Agent installation and Core Services registration  

**Management and operations:**  

:fa-wrench: [Managing Content Files][] - Remote actions for detected patterns (Edit, Error Report, Clear, Show Files)  
:fa-link: [Monitoring Correlated Events][] - Alternative monitoring type for transaction sequences  
:fa-link: [Monitoring Nodinite Diagostics][NNLogFileMonitoring] - Monitor Nodinite diagnostics logs for issues  

**Implementation examples:**  

:fa-server: [Monitor IIS Logs][IISLogFileMonitoring] - HTTP errors and performance patterns  
:fa-file-text: [Monitor File Content][FileContent] - General pattern detection examples  

## :fa-link-horizontal: Related Topics

:fa-chart-line: [Monitoring Correlated Events][] - Track transaction sequences and ACK/NAK patterns  
:fa-wrench: [Managing Content Files][] - Remote actions and alert management  
:fa-gear: [Configuration - Content File][Configuration - Content File] - Complete setup guide  
:fa-question-circle: [Troubleshooting Content Monitoring][Troubleshooting] - Common issues and solutions  

[1]:{ndm}/Documentation%20Pictures/MonitorAgent/LogFileParser/ResourcesInMonitorView.png
[2]:{ndm}/Documentation%20Pictures/MonitorAgent/LogFileParser/LogFileEventsCategory.png
[3]:{ndm}/Documentation%20Pictures/MonitorAgent/LogFileParser/Actions.png
[4]:{ndm}/Documentation%20Pictures/MonitorAgent/LogFileParser/ResourceUnavailable.png

[Alarm Plugins]:{ndr}/Administration/5.%20Settings/1.%20Alarm%20Plugins/Features/What%20is%20an%20Alarm%20Plugin.md
[Applications]:{ndr}/Administration/2.%20Monitor%20Management/5.%20Applications/Features/What%20is%20an%20Application.md
[Audit Trail]:{ndr}/Administration/6.%20Tools/2.%20Log%20Audit%20Search.md
[Categories]:{ndr}/Administration/2.%20Monitor%20Management/4.%20Categories/Features/What%20is%20a%20Category.md
[Clear Errors on Managing Content Files]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Features/Managing%20Content%20Files.md#fa-broom-clear-errors
[Configuration - Content File]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Getting%20started/3B.%20Configuration%20-%20Content%20File.md
[Core Services]:{ndr}/Core%20Services/Overview.md
[Expected State]:{ndr}/Administration/2.%20Monitor%20Management/3.%20Resources/Features/Expected%20State.md
[FileContent]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Troubleshooting/How%20to%20monitor%20file%20content.md
[IISLogFileMonitoring]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Troubleshooting/How%20to%20monitor%20the%20IIS%20(W3SVC)%20log%20files.md
[Install Log File Parser Monitoring Agent]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Getting%20started/2.%20Install.md
[Log File Parser Monitoring Agent]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Overview.md
[Managing Content Files]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Features/Managing%20Content%20Files.md
[Managing Content Files - Edit Thresholds]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Features/Managing%20Content%20Files.md#fa-edit-edit-time-based-thresholds
[Managing Content Files - Error Report]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Features/Managing%20Content%20Files.md#fa-circle-info-error-report
[Managing Content Files - Show Log Files]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Features/Managing%20Content%20Files.md#fa-file-alt-show-log-files
[Monitor Views]:{ndr}/Administration/2.%20Monitor%20Management/1.%20Monitor%20Views/Features/What%20is%20a%20Monitor%20View.md
[Monitoring Correlated Events]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Features/Monitoring%20Correlated%20Events.md
[NNLogFileMonitoring]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Troubleshooting/How%20to%20monitor%20Nodinite%20Diagnostic%20files.md
[Prerequisites for Log File Parser Monitoring Agent]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Getting%20started/1.%20Prerequisites.md
[RegEx]:{ndr}/Administration/1.%20Log%20Management/2.%20Search%20Fields/Features/Search%20Field%20Expressions/Formula/Extract/regex.md
[Remote Actions]:{ndr}/Getting%20Started/3.%20Monitor/Remote%20Actions.md
[Resources]:{ndr}/Administration/2.%20Monitor%20Management/3.%20Resources/Features/What%20is%20a%20Resource.md
[Roles]:{ndr}/Administration/3.%20Access%20Management/1.%20Roles/Features/What%20is%20a%20Role.md
[Troubleshooting]:{ndr}/Logging%20and%20Monitoring/Log%20File%20Parser/Troubleshooting/Overview.md
[Web Client]:{ndr}/Getting%20Started/Overview.md