Skip to content

Commit 088f99f

Browse files
committed
fix: indexTimeSet change
1 parent f00e6af commit 088f99f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

exporter/opensearchexporter/sso_log_exporter.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func newLogExporter(cfg *Config, set exporter.Settings) *logExporter {
3838

3939
return &logExporter{
4040
telemetry: set.TelemetrySettings,
41-
Index: getIndexName(cfg.Dataset, cfg.Namespace, cfg.LogsIndex, cfg.LogDateFormat),
41+
Index: getIndexName(cfg.Dataset, cfg.Namespace, cfg.LogsIndex, cfg.LogDateFormat, time.Now()),
4242
bulkAction: cfg.BulkAction,
4343
httpSettings: cfg.ClientConfig,
4444
model: model,
@@ -71,8 +71,7 @@ func (l *logExporter) pushLogData(ctx context.Context, ld plog.Logs) error {
7171
return indexer.joinedError()
7272
}
7373

74-
func getIndexName(dataset, namespace, index string, dateformat bool) string {
75-
var t time.Time
74+
func getIndexName(dataset, namespace, index string, dateformat bool, t time.Time) string {
7675
if dateformat {
7776
replacer := strings.NewReplacer(
7877
"%{yyyy}", t.Format("2006"),

0 commit comments

Comments
 (0)