Convert data in the “_raw” field to OCSF format
Use the ocsf SPL2 command in an Ingest Processor pipeline to convert data from a raw text format to the Open Cybersecurity Schema Framework (OCSF) format.
If the data that you want to convert to OCSF format is stored in an event field called _raw
, and you want to store the OCSF-formatted results in the _raw
field, then use the ocsf
SPL2 command in your pipeline.
ocsf
command prefixes the specified source type with ocsf:
and then stores the updated source type in the sourcetype
field. This change ensures that your data is associated with a source type that is supported by the OCSF-CIM Add-on for Splunk and Splunk Enterprise Security._raw
field from a raw text format into the OCSF format. The pipeline also prefixes the specified source type with ocsf:
and then stores the updated source type in the sourcetype
field.Example: Use the ocsf command to convert data
_raw | source_device |
---|---|
<166>Oct 06 2021 12:56:34 10.160.0.10 : %ASA-6-611101: User authentication succeeded: IP address: 10.160.39.123, Uname: admin | cisco:asa |
import ocsf from /splunk.ingest.commands
$pipeline = | from $source | ocsf sourcetype=source_device include_raw=true | into $destination;
-
Parses the data from the
_raw
field based on the source type indicated in thesource_device
field. -
Converts the data into OCSF format.
-
Includes a copy of the original data in the
raw_data
attribute in the converted data. -
Overwrites the
_raw
field with the converted data. -
Adds a
sourcetype
field that contains the value from thesource_device
field prefixed withocsf:
.
_raw | source_device | sourcetype |
---|---|---|
|
cisco:asa |
ocsf:cisco:asa |
For more information, see the following pages: