Removes specified fields from each event.

ParameterTypeRequiredDefault ValueDescription
fields[a]array of stringsrequired   The names of the fields to discard.

[a] The parameter name fields can be omitted.

Hide omitted argument names for this function

Show omitted argument names for this function

drop() Syntax Examples

Remove specific field from event set:

This example drops the field f1 from the event set.

logscale
drop(f1)

If input data was f1=a, f2=b, f3=c, it would return:

f2f3
bc

Remove multiple fields from event set:

This example drops the fields f2 and f3 from the event set.

logscale
drop([f2, f3])

If input data was f1=a, f2=b, f3=c, it would return:

f1
a

drop() Examples

Click + next to an example below to get the full details.

Drop Attributes, Columns/Fields From Result Set - Example 1

Drop a single field from a result set using the drop() function

Query
logscale
drop(header)
Introduction

In this example, the drop() function is used to remove the header field from result set.

Step-by-Step
  1. Starting with the source repository events.

  2. logscale
    drop(header)

    Drops a single field named header.

  3. Event Result set.

Summary and Results

The query is used to remove data during ingest, in this example removing a field. Removal of fields are useful if you have created fields in sub-searches (extracted some values in new fields during the filtering process) that are no longer needed in the final result set. If you want to drop an entire event, it is possible to use the dropEvent() function.

Drop Attributes, Columns/Fields From Result Set - Example 2

Drop two fields from a result set using the drop() function

Query
logscale
drop([header,value])
Introduction

In this example, the drop() function is used to remove the fields header and value from result set.

Step-by-Step
  1. Starting with the source repository events.

  2. logscale
    drop([header,value])

    Drops both the field named header and the field named value.

  3. Event Result set.

Summary and Results

The query is used to remove data during ingest, in this example removing more fields. Removal of fields are useful if you have created fields in sub-searches (extracted some values in new fields during the filtering process) that are no longer needed in the final result set. If you want to drop an entire event, it is possible to use the dropEvent() function.

Drop Multiple Fields from Events

Remove multiple fields from all events using an array and the drop() function

Query
logscale
drop([header,value])
Introduction

In this example, the drop() function is used to remove both the header and value fields from all events in the dataset using an array syntax.

Example incoming data might look like this:

@timestampheadermessagestatusvalueuser_id
2025-09-15T10:00:00ZHTTP/1.1User login successful200temp_datauser123
2025-09-15T10:00:01ZHTTP/1.1File uploaded201cache_infouser456
2025-09-15T10:00:02ZHTTP/2.0Authentication failed401debug_valuser789
2025-09-15T10:00:03ZHTTP/1.1Data retrieved200session_iduser123
2025-09-15T10:00:04ZHTTP/2.0Connection timeout408retry_countuser456
Step-by-Step
  1. Starting with the source repository events.

  2. logscale
    drop([header,value])

    Removes both the header and value fields from all events using array syntax. The drop() function accepts an array of field names enclosed in square brackets, allowing multiple fields to be eliminated simultaneously in a single operation.

  3. Event Result set.

Summary and Results

The query is used to remove multiple fields (header and value) from all events in the dataset in a single operation.

This query is useful, for example, to clean up log data by removing multiple redundant fields at once, eliminate several sensitive or temporary fields before data export, or reduce data volume efficiently by dropping multiple unnecessary metadata fields simultaneously.

Sample output from the incoming example data:

@timestampmessagestatususer_id
2025-09-15T10:00:00ZUser login successful200user123
2025-09-15T10:00:01ZFile uploaded201user456
2025-09-15T10:00:02ZAuthentication failed401user789
2025-09-15T10:00:03ZData retrieved200user123
2025-09-15T10:00:04ZConnection timeout408user456

Note that once fields are dropped, they cannot be recovered in subsequent operations within the same query. Both the header and value fields are completely removed from all events. Using array syntax is more efficient than multiple separate drop() operations.

Drop Single Field from Events

Remove the header field from all events using the drop() function

Query
logscale
drop(header)
Introduction

In this example, the drop() function is used to remove the header field from all events in the dataset.

Example incoming data might look like this:

@timestampheadermessagestatususer_id
2025-09-15T10:00:00ZHTTP/1.1User login successful200user123
2025-09-15T10:00:01ZHTTP/1.1File uploaded201user456
2025-09-15T10:00:02ZHTTP/2.0Authentication failed401user789
2025-09-15T10:00:03ZHTTP/1.1Data retrieved200user123
2025-09-15T10:00:04ZHTTP/2.0Connection timeout408user456
Step-by-Step
  1. Starting with the source repository events.

  2. logscale
    drop(header)

    Removes the header field from all events. The drop() function permanently eliminates the specified field from the event data, reducing the amount of data stored and processed in subsequent operations.

  3. Event Result set.

Summary and Results

The query is used to remove the header field from all events in the dataset.

This query is useful, for example, to clean up log data by removing redundant protocol information, eliminate sensitive fields before sharing data, or reduce data volume by dropping unnecessary metadata fields.

Sample output from the incoming example data:

@timestampmessagestatususer_id
2025-09-15T10:00:00ZUser login successful200user123
2025-09-15T10:00:01ZFile uploaded201user456
2025-09-15T10:00:02ZAuthentication failed401user789
2025-09-15T10:00:03ZData retrieved200user123
2025-09-15T10:00:04ZConnection timeout408user456

Note that once a field is dropped, it cannot be recovered in subsequent operations within the same query. The header field is completely removed from all events.