From d302b04256fea04f348c4c45b038b54241fec81b Mon Sep 17 00:00:00 2001 From: jaymode Date: Thu, 18 Jun 2015 15:53:51 -0400 Subject: [PATCH] rename shield audit indices to keep naming consistent This change renames the shield audit indices to keep naming consistent with other plugins. The name of the index uses '_' to separate words, a '-' to separate the prefix from the time portion, and '.'s to separate the different portions of the date. Closes elastic/elasticsearch#925 Original commit: elastic/x-pack-elasticsearch@8ca6856e4a9d0968ed76c1aea3e3f26236fb77b7 --- .../elasticsearch/shield/audit/index/IndexAuditTrail.java | 2 +- .../shield/audit/index/IndexNameResolver.java | 8 ++++---- src/main/resources/shield_audit_log.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/elasticsearch/shield/audit/index/IndexAuditTrail.java b/src/main/java/org/elasticsearch/shield/audit/index/IndexAuditTrail.java index f6726b47015..23d63396333 100644 --- a/src/main/java/org/elasticsearch/shield/audit/index/IndexAuditTrail.java +++ b/src/main/java/org/elasticsearch/shield/audit/index/IndexAuditTrail.java @@ -73,7 +73,7 @@ public class IndexAuditTrail extends AbstractComponent implements AuditTrail { public static final TimeValue DEFAULT_FLUSH_INTERVAL = TimeValue.timeValueSeconds(1); public static final IndexNameResolver.Rollover DEFAULT_ROLLOVER = IndexNameResolver.Rollover.DAILY; public static final String NAME = "index"; - public static final String INDEX_NAME_PREFIX = ".shield-audit-log"; + public static final String INDEX_NAME_PREFIX = ".shield_audit_log"; public static final String DOC_TYPE = "event"; public static final String ROLLOVER_SETTING = "shield.audit.index.rollover"; diff --git a/src/main/java/org/elasticsearch/shield/audit/index/IndexNameResolver.java b/src/main/java/org/elasticsearch/shield/audit/index/IndexNameResolver.java index 4d547bcb504..92198c0e255 100644 --- a/src/main/java/org/elasticsearch/shield/audit/index/IndexNameResolver.java +++ b/src/main/java/org/elasticsearch/shield/audit/index/IndexNameResolver.java @@ -12,10 +12,10 @@ import org.joda.time.format.DateTimeFormatter; public class IndexNameResolver { public enum Rollover { - HOURLY ("-yyyy-MM-dd-HH"), - DAILY ("-yyyy-MM-dd"), - WEEKLY ("-yyyy-w"), - MONTHLY ("-yyyy-MM"); + HOURLY ("-yyyy.MM.dd.HH"), + DAILY ("-yyyy.MM.dd"), + WEEKLY ("-yyyy.w"), + MONTHLY ("-yyyy.MM"); private final DateTimeFormatter formatter; diff --git a/src/main/resources/shield_audit_log.json b/src/main/resources/shield_audit_log.json index c60d226602f..57c9b5ab016 100644 --- a/src/main/resources/shield_audit_log.json +++ b/src/main/resources/shield_audit_log.json @@ -1,5 +1,5 @@ { - "template": ".shield-audit-log*", + "template": ".shield_audit_log*", "order": 2147483647, "settings": { "index.mapper.dynamic" : false