Using Custom Entity Types
Define your own custom entity types to receive data
Custom types allow integrations to receive any data that can be defined with a regular expression. To use a custom type you must define the custom type in your configuration file.
Define Custom Type in Config
In the example below we setup an integration configuration that identifies strings that match a special hostname naming convention.
Test for Custom Type
Now in the main module's doLookup
method we can test if the type is custom
or IPv4
and take the appropriate action.
Note that since the only custom type we defined is hostname
we know that if the type
property is custom
then the entity must be a hostname entity.
Multiple Custom Types
If you have defined multiple custom types you can use javascript's Array.indexOf
to test for specific types.
For example, if we have defined the custom types hostnameLinux
and hostnameWindows
we could test for the entity type in our doLookup
method using the following:
Note that custom types are prepended with custom.
. This means if you want to check for the custom type hostnameLinux
you must look for the type custom.hostnameLinux
. Likewise, hostnameWindows
would be stored in the types
property as custom.hostnameWindows
.
Last updated