Log Files LogSource Configuration
Last updated – 23 November, 2026
The LogFiles LogSource enables Logs to collect logs that are written to files on disk by a deployed and registered LogicMonitor OpenTelemetry (OTel) Collector. After the Collector is configured, you can create a LogFiles LogSource and apply it to the monitored resource that generates the log files.
For more information on configuring the OTel Collector, see OpenTelemetry Installation.
AppliesTo in Log Files LogSource
The AppliesTo Filter (ATF) determines which log data this LogSource applies to.
For Log Files collected through OpenTelemetry, the AppliesTo expression must reference the OpenTelemetry Collector identifier. If the AppliesTo expression does not match the OpenTelemetry Collector name, the LogSource does not process incoming logs.

Important: Configure the AppliesTo expression to match the LM OpenTelemetry (OTel) Collector resource, not the monitored resource that generates the log files. If the AppliesTo expression matches the monitored resource instead of the LM OpenTelemetry Collector resource, the LogSource will not collect logs.
Example AppliesTo Expressions
The following examples demonstrate common AppliesTo expressions that you can copy and modify for your environment.
To match a single OpenTelemetry Collector, use the following expression with its resource display name:
system.displayname == "TEST-OTEL-COLLECTOR_OTEL_48439"
To match multiple OpenTelemetry Collector, use the following expression with their resource display names:
system.displayname == "TEST-OTEL-COLLECTOR_OTEL_48439" || system.displayname == "PROD-OTEL-COLLECTOR_OTEL_51234"
Add additional system.displayname expressions as needed by using the || (OR) operator.
To match an OpenTelemetry Collector Group, use the following expression:
isInGroup("OpenTelemetry Collectors")
Replace OpenTelemetry Collectors with the name of your LogicMonitor resource group.
For more information about creating AppliesTo expressions, see AppliesTo Function Configuration.
Filtering in Log Files LogSource
After the AppliesTo Filter matches, the system evaluates include and exclude filters to determine whether a log is ingested or dropped. You can toggle the AND or OR switch to control how this evaluation occurs. By default, these switches are disabled.
Include Filters
You can add include filters to specify which resources are eligible for log ingestion, such as a specific resource type or application. Logs that match the include filter criteria are forwarded to the log ingestion process.
Exclude Filters
You can add exclude filters to prevent logs from specific resources, resource types, or attributes from being ingested. Logs that match an exclude filter are dropped and are not forwarded to the log ingestion process.
The following table lists the available parameters when configuring LogFiles LogSource:
| Attributes | Comparison operator | Value example |
| Message | RegexMatch, RegexNotMatch. | Regular expression |
Log Fields in Log Files LogSource
You can configure Log Fields (tags) to send additional metadata with the logs.
The following table lists the available parameters:
| Method | Key example | Value example | Description |
| Static | “Customer” | “Customer_XYZ” | Sends a fixed key-value pair with every log. |
| Dynamic(REGEX) | “Host” | “host=*” | Extracts the value from the log message using a regular expression. |
| LM Property(Token) | “Device” | “##system.deviceId##” | Uses a LogicMonitor property token to populate the value at runtime. |
| Dynamic Group Regex | user,host,status | user=(\w+)\s+host=([\w.]+)\s+status=(\d+) | Enables extraction of multiple metadata fields from a single log line using one regular expression with multiple capture groups |
Note: You can use the optional resource_type property to define the resource type applied to all ingested logs.
The resource type value that you specify is used for all logs. If the value is not specified, the system assigns a resource type based on the value of the predef.externalResourceType field in the resource settings.
Resource Mappings in Log Files LogSource
You can configure resource mappings to associate logs with monitored resources using either OR (default) operator or AND operator.
For more information about using AND and OR operators in resource mappings, see Resource Mappings in LogSource Configuration.
The following table describes the available resource-mapping methods:
| Method | Key Example | Value Example | Description |
|---|---|---|---|
| Cloud Host (default) | system.cloud.id | Filled from backend | Maps logs to the cloud resource detected on the Collector host, such as an AWS ARN or Azure resource. Use this method when the OTel Collector runs on a supported cloud virtual machine. |
| Display Name (default) | system.displayname | Filled from backend | Maps logs to the monitored host/server resource using its display name, rather than the OTel Collector resource. |
| LM OTel Host (default) | system.displayname | Filled from backend | Maps logs to the LogicMonitor resource that represents the LM OTel Collector. |
| Token | system.displayname | ##system.displayname## | Resolves a property from the resource monitored by the OTel Collector. Enter the property name as the key and use ##property.name## as the value. |
| Static | Customer_Id | 1921 | Maps logs to a monitored resource by matching a predefined key-value pair to a resource property. |
| Dynamic (REGEX) | system.ServiceName | service=* | Runs the query on the message field. The matching text from the log message is used as the property value for the specified key. |
| Dynamic Group Regex | Scheme, Login | (https*):\/\/([]a-z]+) | The query runs on the message field and captures group values from the regex. Keys can be a comma-separated list; values are read from the same number of groups.For the Dynamic Group Regex key and value example, the regex results in metadata are as following:Scheme=httpsLogin=<Actual username extracted from the message> |
Note: Resource mapping is available with LM OTel Collector version 7.1.0.0 or later. For LM OTel Collector versions earlier than 7.1.0.0, you can manually associate logs with resources by setting the LM_DEVICE_ATTRIBUTES environment variable using key-value pairs.
For example:
LM_DEVICE_ATTRIBUTES="key1=value1"Windows example:
C:\Users\Administrator>setx LM_DEVICE_ATTRIBUTES "system.hostname=EC2AMAZ-5JJHIM0" /mIf logs are not mapped to a resource, they are classified as deviceless. This occurs when either the host is not monitored in LogicMonitor or the host is not a cloud-based resource.
Requirements for Configuring Log Files LogSource
To configure Log Files LogSources, you must have the following:
- A valid Logs subscription.
- LM OTel Collector version 6.1.00 or later configured for Logs.
For more information, see OpenTelemetry Collector for LogicMonitor Overview. - LM OTel Collector version 7.1.0.0 or later for Resource Mappings
Note: This LogSource requires a LogicMonitor OpenTelemetry (LM OTEL) Collector to be installed, registered in LogicMonitor, and in a Running state. Log collection does not occur unless an active LM OTEL Collector is available to collect and forward the log data.
Configuring Log Files LogSource
- In LogicMonitor, navigate to
More > Modules > select
Add. - In the Add window, select LogSource. The Add New LogSource window displays.
- Configure the Basic Information for Info section with required information.
For more information, see Configuring Basic Information for LogSource. - In the Summary for Info section, do the following:
- Select “Logs: Log Files“ in the Type dropdown menu.
- Provide the path name for the log file in the Log File Path field.
You can enter one of the following:- A single log file path.
For example:\\share\logfile.log - A log file path that uses wildcards to collect multiple log files or rollover log files across directories.
For example:C:\inetpub\logs\LogFiles\W3SVC*\u_ex*.log
- A single log file path.
- Assign Access Groups to enable who can view, manage, and interact with the logs.
For more information, see Access Groups. - In the AppliesTo field, enter an AppliesTo expression that matches the OpenTelemetry Collector name deployed on the resource.
For more information, see AppliesTo Function Scripting Overview.
- Configure the fields in the Filters section.
For more information for configuring Filters for LogSource, see Configuring Filters for LogSource. - Configure Log Fields (tags) to send additional metadata with the logs.
For more information for configuring Log Fields in LogSource, see Configuring Log Fields in LogSource . - In the Sensitive Data Masking section, you can either select Load Default Data Masking Rules to use the predefined masking rules provided by LogicMonitor or create custom masking rules to define how sensitive data is detected and masked.
To create a custom masking rule, do the following:- Select
Add Sensitive Data Masking Rules. - Select an option from the Type dropdown menu. For example, Regex.
- In the Key field, enter the masking rule name. This identifies the type of sensitive data being masked.
- In the Masking Rule field, define the pattern used to detect sensitive data.
- In the Masked Value field, enter the replacement value. This value displays instead of the sensitive data.
- (Optional) Add additional details in the Description field.

- Select
Save. The masking rule is added. Note:- To edit an existing masking rule, select the masking rule and update the required fields.
- To disable a sensitive data masking rule, delete the rule.
- Select
- Configure Resource Mappings to associate logs with monitored devices.
For more information, see Configuring Resource Mapping for LogSource.
- Select
Save.
The LogSource is configured and available for use.


