# US 2022/0292304 A1 · Multi-stage feature extraction for effective ml-based anomaly detection on structured log data

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2022/0292304 A1
- Document ID: US20220292304A1
- Status: Published application
- Kind: A1
- Application number: 17/199,563
- Filed: 2021-03-12
- Published: 2022-09-15
- Earliest claimed: 2021-03-12
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: AMIN SUZANI; SAEID ALLAHDADIAN; MILOS VASIC; MATTEO CASSERINI; HAMED AHMADI; FELIX SCHMIDT; ANDREW BROWNSWORD; NIPUN AGARWAL
- Web page: https://patentgrep.com/patent/US20220292304A1

## CPC

- G06F 18/214: Generating training patterns; Bootstrap methods, e.g. bagging or boosting
- G06F 18/23: Clustering techniques
- G06N 3/0455: Auto-encoder networks; Encoder-decoder networks
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 3/088: Non-supervised learning, e.g. competitive learning
- G06N 20/00: Machine learning
- G06V 10/758: {Involving statistics of pixels or of feature values, e.g. histogram matching}
- G06N 5/01: Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
- G06N 20/20: Ensemble learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

Herein are feature extraction mechanisms that receive parsed log messages as inputs and transform them into numerical feature vectors for machine learning models (MLMs). In an embodiment, a computer extracts fields from a log message. Each field specifies a name, a text value, and a type. For each field, a field transformer for the field is dynamically selected based the field's name and/or the field's type. The field transformer converts the field's text value into a value of the field's type. A feature encoder for the value of the field's type is dynamically selected based on the field's type and/or a range of the field's values that occur in a training corpus of an MLM. From the feature encoder, an encoding of the value of the field's typed is stored into a feature vector. Based on the MLM and the feature vector, the log message is detected as anomalous or not.

## Claims

### Claim 1

A method comprising:
extracting a plurality of fields from a log message, wherein each field of the plurality of fields specifies: a name, a text value, and a type;
for each field of the plurality of fields:
a) dynamically selecting a field transformer for the field, wherein the selecting the field transformer is based on at least one selected from the group consisting of: the name of the field and the type of the field;
b) converting, by the field transformer, the text value of the field into a value of the type of the field;
c) dynamically selecting a feature encoder for the value of the type of the field, wherein the selecting the feature encoder is based on at least one selected from the group consisting of: the type of the field and a range of values of the field that occur in a training corpus of a machine learning (ML) model; and
d) storing, from the feature encoder, an encoding of the value of the type of the field into a feature vector;
detecting, based on the ML model and the feature vector, whether the log message is anomalous.

### Claim 2 (depends on 1)

The method of claim 1 wherein for a particular field of said plurality of fields:
said converting the text value of the particular field by the field transformer comprises extracting, by the field transformer, a nested plurality of fields from the text value of the particular field;
for each nested field of the nested plurality of fields:
a) the method further comprises:
dynamically selecting a nested field transformer for the nested field, and
converting, by the nested field transformer, the text value of the nested field into a value of the type of the nested field;
b) said dynamically selecting the feature encoder for the value of the type of the field comprises dynamically selecting a nested feature encoder for the value of the type of the nested field;
c) said storing the encoding of the value of the type of the field comprises storing, from the nested feature encoder, an encoding of the value of the type of the nested field into the feature vector.

### Claim 3 (depends on 2)

The method of claim 2 wherein the text value of the particular field comprises a shell command.

### Claim 4 (depends on 3)

The method of claim 3 wherein:
the shell command specifies a command-line interpreter;
the nested plurality of fields does not specify the command-line interpreter;
said detecting whether the log message is anomalous does not comprise the ML model inferencing based on the command-line interpreter.

### Claim 5 (depends on 3)

The method of claim 3 wherein:
the shell command specifies a sudo;
the nested plurality of fields includes a sudo field;
the type of the sudo field is Boolean;
said detecting whether the log message is anomalous comprises the ML model inferencing based on the sudo field.

### Claim 6 (depends on 3)

The method of claim 3 wherein:
the shell command specifies a loop;
the nested plurality of fields includes a loop field;
the type of the loop field is Boolean;
said detecting whether the log message is anomalous comprises the ML model inferencing based on the loop field.

### Claim 7 (depends on 3)

The method of claim 3 wherein:
the shell command specifies a file path of a program and a filename of the program;
the nested plurality of fields includes a program filename field that specifies the filename of the program;
the nested plurality of fields does not specify the file path of the program;
said detecting whether the log message is anomalous does not comprise the ML model inferencing based the file path of the program.

### Claim 8 (depends on 3)

The method of claim 3 wherein:
the shell command specifies one or more switch arguments;
the nested plurality of fields includes an options field that specifies the one or more switch arguments;
said detecting whether the log message is anomalous comprises the ML model inferencing based on the options field.

### Claim 9 (depends on 3)

The method of claim 3 wherein:
the shell command specifies a path argument;
the nested plurality of fields includes a path field that indicates whether the path argument matches a path pattern;
the type of the path field is Boolean;
said detecting whether the log message is anomalous comprises the ML model inferencing based on the path field.

### Claim 10 (depends on 2)

The method of claim 2 wherein:
the text value of the particular field comprises a network address;
the nested plurality of fields includes a network field that indicates whether the network address satisfies one selected from the group consisting of:
the network address is an internet protocol (IP) address,
the network address belongs to a particular public pool of IP addresses,
the network address belongs to a particular demilitarized zone (DMZ),
the network address is a private IP address,
the network address contains a well-known port assignment for a protocol, and
the network address represents localhost;
the type of the network field is Boolean;
said detecting whether the log message is anomalous comprises the ML model inferencing based on the network field.

### Claim 11 (depends on 2)

The method of claim 2 wherein:
the text value of the particular field comprises a network address;
the nested plurality of fields includes a network field selected from the group consisting of:
a country of the network address,
a port of the network address, and
a port category of the network address indicating one of: well known, registered, and dynamic;
said detecting whether the log message is anomalous comprises the ML model inferencing based on the network field.

### Claim 12 (depends on 2)

The method of claim 2 wherein:
the text value of the particular field comprises a device identifier that comprises a major part and a minor part;
the nested plurality of fields includes a device field;
the value of the device field is the major part of the device identifier;
said detecting whether the log message is anomalous comprises the ML model inferencing based on the device field.

### Claim 13 (depends on 2)

The method of claim 2 wherein:
the text value of the particular field comprises an exit code
the nested plurality of fields includes an exit field that indicates whether the exit code is one of: EPERM, ENOENT, ESRCH, E2BIG, ENOMEM, EACCES, ENFILE, EMFILE, ETXTBSY, EFBIG, ENOSPC, ESPIPE, EL2HLT, EBFONT, ENOSTR, EMULTIHOP, EBADMSG, ENOTUNIQ, EBADFD, EREMCHG, ELIBBAD, ELIBMAX, EILSEQ, EUSERS, and ECONNREFUSED;
the type of the exit field is Boolean;
said detecting whether the log message is anomalous comprises the ML model inferencing based on the exit field.

### Claim 14 (depends on 2)

The method of claim 2 wherein:
the text value of the particular field comprises a security-enhanced Linux (SELinux) context;
the nested plurality of fields includes an SELinux field selected from the group consisting of: a user, a role, a sensitivity, and a compartment;
said detecting whether the log message is anomalous comprises the ML model inferencing based on the SELinux field.

### Claim 15 (depends on 2)

The method of claim 2 wherein:
the text value of the particular field comprises a name of a user;
the nested plurality of fields includes a user field that indicates whether the user satisfies one selected from the group consisting of:
the user is root,
the user is local, and
the user is a local group administrator;
the type of the user field is Boolean;
said detecting whether the log message is anomalous comprises the ML model inferencing based on the user field.

### Claim 16 (depends on 1)

The method of claim 1 wherein:
for a particular field of the plurality of fields, said storing the encoding of the value of the type of the particular field comprises storing, into the feature vector, an encoding of a Boolean that indicates whether said range of values of the particular field that occur in the training corpus does not contain the value of the type of the particular field;
said detecting whether the log message is anomalous comprises the ML model inferencing based on said Boolean that indicates whether said range of values of the particular field does not contain the value of the type of the particular field.

### Claim 17 (depends on 1)

The method of claim 1 wherein for a particular field of the plurality of fields, said dynamically selecting the feature encoder for the value of the type of the particular field comprises selecting a hash encoder when said range of values of the particular field that occur in the training corpus contains at least 128 values.

### Claim 18 (depends on 17)

The method of claim 17 wherein said storing the encoding of the value of the type of the particular field comprises storing into the feature vector:
at least 128 encoded Booleans, and
when said range of values of the particular field that occur in the training corpus contains more than 512 values, at most 512 encoded Booleans.

### Claim 19 (depends on 17)

The method of claim 17 wherein said storing the encoding of the value of the type of the particular field comprises storing into the feature vector an amount of Booleans that is inversely proportional to a scaling factor that is based on at least one selected from the group consisting of:
a target collision rate, and a count of values in said range of values of the particular field that occur in the training corpus.

### Claim 20 (depends on 1)

The method of claim 1 wherein for a particular field of the plurality of fields:
said range of values of the particular field that occur in the training corpus consists of a plurality of integers;
said storing the encoding of the value of the type of the particular field comprises storing into the feature vector:
a zero when the value of the type of the particular field is a minimum value in the plurality of integers,
a one when the value of the type of the particular field is a maximum value in the plurality of integers, and
otherwise, a value that is exclusively between zero and one.

### Claim 21

One or more computer-readable non-transitory media storing instructions that, when executed by one or more processors, cause:
extracting a plurality of fields from a log message, wherein each field of the plurality of fields specifies: a name, a text value, and a type;
for each field of the plurality of fields:
a) dynamically selecting a field transformer for the field, wherein the selecting the field transformer is based on at least one selected from the group consisting of: the name of the field and the type of the field;
b) converting, by the field transformer, the text value of the field into a value of the type of the field;
c) dynamically selecting a feature encoder for the value of the type of the field, wherein the selecting the feature encoder is based on at least one selected from the group consisting of: the type of the field and a range of values of the field that occur in a training corpus of a machine learning (ML) model; and
d) storing, from the feature encoder, an encoding of the value of the type of the field into a feature vector;
detecting, based on the ML model and the feature vector, whether the log message is anomalous.

### Claim 22 (depends on 21)

The one or more computer-readable non-transitory media of claim 21 wherein for a particular field of said plurality of fields:
said converting the text value of the particular field by the field transformer comprises extracting, by the field transformer, a nested plurality of fields from the text value of the particular field;
for each nested field of the nested plurality of fields:
a) the instructions further cause:
dynamically selecting a nested field transformer for the nested field, and
converting, by the nested field transformer, the text value of the nested field into a value of the type of the nested field;
b) said dynamically selecting the feature encoder for the value of the type of the field comprises dynamically selecting a nested feature encoder for the value of the type of the nested field;
c) said storing the encoding of the value of the type of the field comprises storing, from the nested feature encoder, an encoding of the value of the type of the nested field into the feature vector.

### Claim 23 (depends on 22)

The one or more computer-readable non-transitory media of claim 22 wherein the text value of the particular field comprises a shell command.
