JDBC Job

Overview

JDBC (Java Database Connectivity Technology) is an API for Java which provides methods for querying and updating a database.

Axibase Collector can be configured to query a remote database to either obtain current statistics for the purpose of accumulating their history in Axibase Time Series Database or to offload incremental statistics into ATSD for long-term retention and analytics.

Supported Databases

  • Oracle Database
  • Microsoft SQL Server
  • IBM DB2
  • MySQL
  • PostgreSQL
  • Sybase
  • Apache Derby
  • SAP HANA
  • OSIsoft PI
  • HP Vertica
  • ATSD
  • CUSTOM

Examples

Job Settings

Apart from common, JDBC job has an additional field.
Data Source list allows you to select a database that will be queried. The list contains all databases connected as data sources.

JDBC job settings

Job Configuration

To add a new query, on the JDBC Job page click 'Create Query'.
Use the table below to fill in the fields and configure the query.

FIELDDESCRIPTION
QuerySELECT query containing the entity name, time, and a list of metric columns.
Command TypeType of command sent to ATSD. Possible values: SERIES, PROPERTY, MESSAGE, METRIC, ENTITY.
Default EntityDefault entity assigned to the collected commands.
Entity ColumnRetrieve entity value from the specified entity column.
Entity Replacement ExpressionFreemarker expression to extract entity name from an input string or to retrieve it from a lookup table using LOOKUP.
Split ConditionOne or multiple WHERE conditions to copy the base query into multiple queries returning smaller resultsets.
Tag ColumnsColumns that contain series tags.
Predefined TagsAssign predefined tags to all series.
Time ColumnColumn containing the timestamp.
Last Time ColumnColumn containing last update time.
Time TypeTimestamp type.
Possible values: TIMESTAMP, TIVOLI, TEXT, UNIX
Time FormatFormat of the timestamp.
Time RoundTime will be rounded before storing the series in ATSD.
Possible values: MILLISECOND, SECONDS, MINUTE, HOUR, DAY
Time ZoneTime zone in which the data was originally collected and stored.
Check Last TimeIgnore metrics that have time set to less than the previous entry.
Query With TimeWhen executing the job, the server will be set to the maximum time of the previous data.
Collection Start TimeCalendar expression defining the beginning of the data collection interval, for example, previous_week.
Max RowsMaximum number of rows that will be collected with each batch, -1 is unlimited.
Query Timeout SecondsNumber of seconds after which the query will be interrupted, -1 is unlimited.

Placeholders

Default Entity and Predefined Tags fields support the following placeholders:

PlaceholderDescription
${DB_CONFIG_NAME}Data source Name.
${DB_SERVER}Data source Server.
${DB_PORT}Data source Port.
${DB_NAME}Data source Database Name.

Type-Specific options

SERIES
FIELDDESCRIPTION
Metric ColumnsColumns containing metric values
Ignored Metric ColumnsMetric columns that you want to skip.
Default Metric NameAssign a default metric to the collected series. All series will be stored in ATSD with this metric.
Metric Name ColumnColumn containing metric (series) names.
Metric Value ColumnColumn containing metric (series) values. It is possible to collect multiple value columns for the same metric, as is common in aggregation queries. For example: cnt, avg, max, min, sum.
Example query:
SELECT st.SAMPLE_TIME, e.ENTITY_NAME, sd.NAME AS METRIC,
COUNT(hs.STAT_VAL) AS "cnt",
AVG(hs.STAT_VAL) AS "avg",
SUM(hs.STAT_VAL) AS "sum",
MAX(hs.STAT_VAL) AS "max",
MIN(hs.STAT_VAL) AS "min"
FROM VPX_HIST_STAT1 ...
Metric PrefixMetric prefix can be assigned to easily sort and differentiate metrics in ATSD.
Ignore Number Parse ErrorsIgnore cells that fail to parse from string into number without raising error. Default: false.

PROPERTY

FIELDDESCRIPTION
Property TypeDefault property type for all property commands, or column containing property type
Property Key ColumnsColumns containing strings that will be treated as property keys
Property Value ColumnsIf specified, only listed columns will be considered a source of property values. By default all unused columns are treated as property values
Ignored Property Value ColumnsColumns to be excluded from list of property values
MESSAGE
FIELDDESCRIPTION
TypeType applied to all messages, or column containing message type
SourceSource applied to all messages, or column containing message source
SeverityString representation of message severity. Either a selected value or a column containing severity
METRIC
FIELDDESCRIPTION
Metric Name ColumnColumn containing metric names.
Label ColumnLabel Column: Column containing metric or entity label.Default Label: Label applied to all generated metrics or entities
Description ColumnColumn containing metric or entity description.
Data TypeDefault metric data type, or column containing metric datatype. One of: short, integer, long, float, double, decimal
Interpolation ModeDefault interpolation mode setting or column containing interpolation mode setting. Should contain a string value, case-insensitive. Possible values: LINEAR, PREVIOUS, or NONE
Filter ColumnColumn containing metric filter expression.
VersioningDefault versioning behavior if versioning column is not specified, or column specifying if metric is versioned.
Min and Max Value ColumnsMinimum and Maximum Values
UnitsMeasurement Units
Metric Time ZoneDefault Time Zone or column containing the Time Zone Identifier
ENTITY
FIELDDESCRIPTION
Label ColumnLabel Column: Column containing metric or entity label.Default Label: Label applied to all generated metrics or entities
Interpolation ModeDefault interpolation mode setting or column containing interpolation mode setting. Should contain a string value, case-insensitive. Possible values: LINEAR, PREVIOUS, or NONE
Entity Time ZoneDefault Time Zone or column containing the Time Zone Identifier

Configuration Example

The image below shows an example JDBC query configuration.

JDBC Query