Data Sync - Get Data Sync Policies

URI

https://164.99.19.131:8443/SentinelRESTServices/datasync/policies

Supported Methods

GET

This API gets all of the currently defined data sync policies.

Authentication

Authentication Types
Sentinel Permissions Needed

Supported Formats

Response

URL Parameters

None.

Success Codes

Fault Codes

Response Data

Object type: Data sync policy array
Collection of data sync policy objects
FieldDescription
EventDataSyncPolicyThis is an array of <B>&lt;Data Sync Policy&gt;</B> objects. See below for a description of fields in Data Sync Policy objects.

Response Data

Object type: Data sync policy object
Information about the data sync policy
FieldDescription
alwaysScheduleBoolean flag specifying whether data syncing is to run continuously ("true") or according to a schedule ("false"). If "false", the ScheduleItems field specifies the schedule to be used for syncing data.
backOffPeriodThe number of seconds to backoff between queries when the synced-to time is up to date.
countColumnColumn in destination table where event counts are to be stored. The type of this column should be capable of storing an integer.
dbConnectionConfigThis is a nested JSON <B>&lt;Database Connection&gt;</B> object that specifies the destination database to sync data to. It is used in conjunction with the <B>table</B> field to specify the destination table events are to be synced to. See below for description of fields in Database Connection objects. NOTE: If this field is missing, the policy is syncing event data to a table in the internal embedded database.
doSummariesBoolean flag specifying whether this policy creates event summary records instead of syncing individual events. If this field is not present, it defaults to false - i.e., the policy is NOT a summary policy. If true, then the <B>summaryPeriod</B>, <B>countColumn</B>, <B>timeColumn</B>, and <B>summaryKeyColumn</B> fields will aos contain information.
enabledBoolean flag specifying whether the policy is enabled or not.
fieldMappingStatusThis is a nested JSON <B>&lt;Field Mapping Status&gt;</B> object that indicates if there are problems with the destination table and/or column mappings. See below for description of fields in Field Mapping Status objects. NOTE: If this field is missing, there are no problems with the table and its column mappings.
filterThe Lucene filter specifying which events are to be synced.
forReportingThis is a flag that indicates whether the data sync policy is associated with a report. If true, the data sync policy was created for a specific report to sync event data for the report into the internal embedded database. The following fields should also be present to give more information about the report plugin the policy is associated with: <B>reportPluginName</B>, <B>reportPluginDisplayName</B>, <B>reportPluginDescription</B>, <B>reportPluginVersion</B>, and <B>reportPluginReleaseDat</B>.
idThis is the UUID of the data sync policy
maxBatchSizeThe maximum number of events to write to the destination database in a single transaction.
maxEPSSizeThe maximum number of events per second to sync.
partitionTableA flag indicating whether the table is partitioned. NOTE: This only applies to data sync policies that sync data to the internal Postgres database.
reportPluginDescriptionThis is the description of the report plugin the data sync policy is associated with. It will only be present if the <B>forReporting</B> field is "true".
reportPluginDisplayNameThis is the display name of the report plugin the data sync policy is associated with. It will only be present if the <B>forReporting</B> field is "true".
reportPluginNameThis is the name of the report plugin the data sync policy is associated with. It will only be present if the <B>forReporting</B> field is "true".
reportPluginReleaseDateThis is the release date of the report plugin the data sync policy is associated with. It will only be present if the <B>forReporting</B> field is "true".
retentionPeriodThe number of days to retain data before deleting it. If missing, or if it contains a value <= 0, data is not deleted.
ScheduleItemsIf the <B>alwaysSchedule</B> field is "false", this is a nested JSON object that specifies the schedule to use for doing data sync. Note that it contains a single internal field <B>scheduleItem</B> that is an array of <B>&lt;Schedule Item&gt;</B> objects. See below for description of fields in Schedule Item objects.
startSyncTimeThis is the time that the data sync started from. It is specified in milliseconds since midnight, January 1, 1970 (UTC).
summaryKeyColumnColumn in destination table that holds a special summary key. The type of this column should be a VARCHAR capable of storing a 36 character UUID. This column is used internally when it is necessary to update a summary record. NOTE: This column should be indexed for performance reasons.
summaryPeriodNumber of minutes to summarize events over. All events having a common set of event fields (as specified in the <B>TableColumnMap</B> field) will be counted over time periods of this length. A single record with a count of events found during the time period will be stored in the destination table. NOTE: This must be a positive number. If omitted, or the value is <= 0, the policy will be treated as a normal data sync policy - i.e., it will NOT produce summaries.
syncInternalEventsBoolean flag indicating whether or not to sync internal events.
tableThis is a nested JSON <B>&lt;Table&gt;</B> object that specifies the destination table events are to be synced to. See below for description of fields in Table objects. NOTE: If this field is missing, the policy is syncing event data to the "events" table.
TableColumnMapThis is a nested JSON object that specifies the mappings between event fields and destination table columns. Note that it contains a single internal field <B>ColumnMap</B> that is an array of <B>&lt;Column Map&gt;</B> objects. See below for description of fields in Column Map objects.
timeColumnColumn in destination table where event time will be stored. Event time for a summary record is defined to be the time at the beginning of the summary period. For example, if the summary period is two minutes, then event times would potentially fall on every two minute boundary (such as 12:00, 12:02, 12:04, etc). The count would be the count of all events which occurred starting from that time for the duration of the summary. If the time column contained a time of 12:02, then the summary record contains a count is for all events that occurred between >= 12:02 and < 12:04 (note it is exclusive of 12:04). NOTE: This column should be indexed for performance reasons.

Response Data

Object type: Data sync schedule item
Information about the data sync schedule for this policy
FieldDescription
dayOfWeekDay of the week data sync should occur in. 0=Sunday, 1=Monday, etc. -1=Every Day
durationNumber of minutes the data sync should last. 1 through 1440 (number of minutes in a day)
startHourHour of the day the data sync should start. 0 through 23.
startMinuteMinute of the hour the data sync should start. 0 through 59.

Response Data

Object type: Database connection object
Information about the connection to the database where the data sync data is to be stored
FieldDescription
databaseName of database.
dbPlatformType of database. Valid values are: "postgresql", "oracle11g", and "mssql2008".
hostNameName or IP address of host where database resides.
passwordPassword of database user.
portPort number for communication with database system.
userNameUser name of database user to login to database.

Response Data

Object type: Database table object
Information about the database table where the data sync data is to be stored
FieldDescription
schemaNameName of the schema for the destination table. NOTE: This is an optional field. It will default to the schema of the database user specified in the database connection information.
tableNameName of the destination table.

Response Data

Object type: Database field mapping status object
Status of database mapping
FieldDescription
InvalidMappingsThis is a nested JSON object that specifies which of the mappings between event fields and destination table columns are invalid. Note that it contains a single internal field <B>columnMap</B> that is an array of <B>&lt;Column Map&gt;</B> objects. See below for description of fields in Column Map objects. If this field is missing, there are no invalid field/column mappings.
tableStatusA status code indicating any problems with the table. 0=No problems, 1=Error occurred checking table (see server log), 2=Table does not exist, 3=The "summary time" column is not indexed, 4=The "summary key" column is not indexed, 5=The "summary time" and "summary key" columns are not indexed. 6=The "event time" field is not synced as a timestamp (or date) and needs to be in order to support a retention period or table partitioning. 7=The column holding the "event time" field is not indexed and needs to be in order to support a retention period. NOTE: Status codes 3, 4, and 5 are applicable only to data sync policies that do summaries.

Response Data

Object type: Data sync column mapping object
Information about how the lucene fields map to the database fields
FieldDescription
columnNameName of column in the database that the event field is to be stored in.
columnSizeSize of database column. NOTE: This only applies if the database column is a VARCHAR.
columnTypeData type of database column. Should be a java.sql.Types value (BIGINT, VARCHAR, etc.).
eventFieldName of event field that is to be synced. NOTE: These are the names of the event fields as specified <a target="_top" href="http://www.novell.com/developer/event_schema.html">here</a> in the <B>Tag Name</B> column.
nullableFlag indicating whether database column can have null values. 0=Nulls not allowed, 1=Nulls allowed, 2=Unknown if nulls allowed.

Sample Request

GET /datasync/policies 
Sample Response for application/json
Status: 200
Data Sync Policy Fields&#10;{&#10;   "id": "102B21D0-BE9B-102D-83DB-001A6B6D3CF6",&#10;   "policyName": "My Data Sync Policy",&#10;   "enabled": "true",&#10;   "filter": "sev:[3 TO 5]",&#10;   "syncInternalEvents": "false",&#10;   "lagTime": "10",&#10;   "retentionPeriod": "90",&#10;   "partitionTable": "false",&#10;   "backOffPeriod": "60",&#10;   "maxEPSSize": "1000",&#10;   "maxBatchSize": "100",&#10;   "alwaysSchedule": "false",&#10;   "ScheduleItems": { "scheduleItem": [{&lt;Schedule Item&gt;},{&lt;Schedule Item&gt;}...]},&#10;   "dbConnectionConfig":{&lt;Database Connection&gt;},&#10;   "table": {&lt;Table&gt;},&#10;   "fieldMappingStatus": {&lt;Field Mapping Status&gt;},&#10;   "TableColumnMap": { "ColumnMap": [{&lt;Column Map&gt;},{&lt;Column Map&gt;} ....]}&#10;   "doSummaries": "false",&#10;   "summaryPeriod": "0",&#10;   "countColumn": "summary_count",&#10;   "timeColumn": "summary_time",&#10;   "summaryKeyColumn": "summary_key",&#10;   "startSyncTime": "1288177541000",&#10;   "forReporting": "false"&#10;}&#10;&#10;Schedule Item Fields&#10;&#10;{&#10;   "dayOfWeek": "0",&#10;   "startHour": "11",&#10;   "startMinute": "23",&#10;   "duration": "120"&#10;}&#10;&#10;Database Connection Fields&#10;&#10;{&#10;   "hostName": "164.99.19.125",&#10;   "port": "5432",&#10;   "database": "SIEM",&#10;   "userName": "appuser",&#10;   "password": "star1111",&#10;   "dbPlatform": "postgresql",&#10;}&#10;&#10;Table Fields&#10;{&#10;   "schemaName": "my_schema",&#10;   "tableName": "my_event_table"&#10;}&#10;&#10;Field Mapping Status Fields&#10;&#10;{&#10;   "tableStatus": "2",&#10;   "InvalidMappings": {"columnMap":[{&lt;Column Map&gt;},{&lt;ColumnMap&gt;}...]}&#10;}&#10;&#10;Column Map Fields&#10;&#10;{&#10;   "eventField": "msg",&#10;   "columnName": "msg",&#10;   "columnType": "12",&#10;   "nullable": "1",&#10;   "columnSize": "4000"&#10;}&#10;