--- title: Edit raw log data before processing in Health Log Analytics description: Use the Data Input Preprocessor to filter, split, or sanitize raw log data before it is treated in the MID Server and mapped and structured by Health Log Analytics. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/it-operations-management/health-log-analytics/hla-data-input-preprocess.html release: australia product: Health Log Analytics classification: health-log-analytics topic_type: task last_updated: "2026-03-12" reading_time_minutes: 5 keywords: [ServiceNow, Health Log Analytics, HLA, change raw log data, edit raw log messages, user names, passwords, disable raw log samples] breadcrumb: [Set up HLA on your instance, Configuring, Health Log Analytics, ITOM AIOps, IT Operations Management] --- # Edit raw log data before processing in Health Log Analytics Use the Data Input Preprocessor to filter, split, or sanitize raw log data before it is treated in the MID Server and mapped and structured by Health Log Analytics. ## Before you begin Role required: evt\_mgmt\_admin ## About this task Define a JavaScript function to preprocess your raw log data before it reaches Health Log Analytics. For example, you can drop irrelevant or redundant messages to reduce log volume. You can also split multi-event log lines into discrete messages for accurate mapping or sanitize sensitive or personally identifiable information so that it never enters the ServiceNow instance. ## Procedure 1. Navigate to **All** > **Health Log Analytics** > **Data Input Preprocessor**. 2. Open a record. **Note:** The first time the preprocessing form is displayed, Health Log Analytics fetches log samples automatically. In subsequent sessions, fetch fresh samples manually by selecting **Refresh Samples**. 3. Prevent showing log samples that are taken from your organization’s raw logs by selecting **Disable raw log samples**. Select this option if you don't want to expose your logs to Health Log Analytics. 4. View how the current JavaScript function affects the log lines. 1. Add a sample message in the **Test manual sample** field. 2. Select **Go**. 3. Note how the JavaScript function affects the log lines. 5. In the **Raw input samples** field, choose a log sample that will show the effect of the new JavaScript function you're going to define on log lines when you test it. 6. Define a JavaScript function that modifies your raw log data before Health Log Analytics maps and structures it. **Note:** \(ACC data inputs only\) When the Agent Client Collector switches to a different MID Server to provide failover protection, it must switch to a different ACC data input. Therefore, all ACC data inputs must have the same JavaScript function. Health Log Analytics provides the latest published JavaScript function to all existing and future ACC data inputs, replacing the previous script. This feature is supported in the Health Log Analytics application, Version 22.0.12 - December 2021 and later, available from the [ServiceNow Store](https://store.servicenow.com/sn_appstore_store.do#!/store/home). For information about failover protection in Agent Client Collector Log Analytics \(ACC-L\), see [Agent Client Collector Log Analytics](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/agent-client-collector/acc-log-analytics.md). 1. In the JavaScript console, either change the provided default JavaScript function, modify an existing custom JavaScript function, or define a new one. **Note:** In addition to the default JavaScript function for data preprocessing, Health Log Analytics provides a JavaScript function template named Scrubbing. This JavaScript function removes personally identifiable information such as email addresses, social security numbers, and passwords, from the raw log data. The template can act as a starting point for your custom script code. This feature is supported in the Health Log Analytics application, Version 20.0.11 - July 2021, available from the [ServiceNow Store](https://store.servicenow.com/sn_appstore_store.do#!/store/home). **Note:** \(ACC data inputs only\) Make sure that your JavaScript function can be used to handle data streamed by all ACC data inputs. JavaScript functions for preprocessing raw log data use the following objects: - Signature: function process\(sample, metadata\)
| Object | Description |
|---|---|
| sample | The current log sample. |
| metadata | Object that contains the event stream. To access the event stream, call the metadata.eventStream function. Because event stream is an object, you can access each of its properties by calling the metadata.eventStream.origin or metadata.eventStream.LocalPort functions. The list of available event stream properties is available in the **Event Stream: access via metadata** tab. |