function elasticsearch_watchdog_get_mapping in Elasticsearch Connector 7.2
Same name and namespace in other branches
- 7.5 modules/elasticsearch_watchdog/elasticsearch_watchdog.admin.inc \elasticsearch_watchdog_get_mapping()
- 7 modules/elasticsearch_watchdog/elasticsearch_watchdog.admin.inc \elasticsearch_watchdog_get_mapping()
Default index mapping for the elasticsearch watchdog index.
Parameters
integer $ttl: Time To Live setting.
Return value
array The mapping index array.
1 call to elasticsearch_watchdog_get_mapping()
- elasticsearch_watchdog_create_type in modules/
elasticsearch_watchdog/ elasticsearch_watchdog.admin.inc - Create Elasticsearch watchdog type.
File
- modules/
elasticsearch_watchdog/ elasticsearch_watchdog.admin.inc, line 116 - Created on Jan 06, 2014
Code
function elasticsearch_watchdog_get_mapping($ttl = NULL) {
if (!isset($ttl)) {
$ttl = variable_get('elasticsearch_watchdog_ttl', ELASTICSEARCH_WATCHDOG_DEFAULT_INTERVAL);
}
// Index Mapping
$my_type_mapping = array(
'_source' => array(
'enabled' => TRUE,
),
'_all' => array(
'enabled' => FALSE,
),
'_ttl' => array(
'enabled' => TRUE,
'default' => $ttl,
),
'properties' => array(
'uid' => array(
'type' => 'integer',
),
'username' => array(
'type' => 'string',
'index' => 'not_analyzed',
),
'type' => array(
'type' => 'string',
'index' => 'not_analyzed',
),
'message' => array(
'type' => 'string',
'index' => 'not_analyzed',
),
'full_massage' => array(
'type' => 'string',
),
'variables' => array(
'type' => 'string',
'index' => 'not_analyzed',
),
'severity' => array(
'type' => 'string',
'index' => 'not_analyzed',
),
'link' => array(
'type' => 'string',
'index' => 'not_analyzed',
),
'location' => array(
'type' => 'string',
'index' => 'not_analyzed',
),
'referer' => array(
'type' => 'string',
'index' => 'not_analyzed',
),
'hostname' => array(
'type' => 'string',
'index' => 'not_analyzed',
),
'domain' => array(
'type' => 'string',
'index' => 'not_analyzed',
),
'timestamp' => array(
'type' => 'long',
),
'microtime' => array(
'type' => 'float',
),
'date' => array(
'type' => 'date',
),
),
);
return $my_type_mapping;
}