Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 6, 2025

Documents sent from Kafka to Elasticsearch lack timestamp fields, preventing time-based queries and visualizations.

Changes

  • New TimestampFilter: Adds @timestamp field (ISO 8601 format) to documents lacking one
  • Configuration: AddTimestamp boolean in ElasticSearchConf (defaults to true)
  • Filter ordering: Timestamp filter runs first, ensuring timestamps exist before user filters execute
  • Preservation: Existing @timestamp fields are left untouched

Usage

Output:
  ElasticSearch:
    Hosts:
      - "http://172.16.188.73:9200"
    Index: "go-stash-{{yyyy.MM.dd}}"
    AddTimestamp: true  # Disable with false if needed

Documents without @timestamp will now receive 2006-01-02T15:04:05.000Z formatted timestamps in UTC.

Original prompt

This section details on the original issue you should resolve

<issue_title>go-stash支持自动生成时间戳吗</issue_title>
<issue_description>image
我使用go-stash订阅kafka,然后吐给es,但是数据里没有时间戳</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add timestamp support for go-stash data Add automatic @timestamp field generation for Elasticsearch documents Nov 6, 2025
Copilot AI requested a review from kevwan November 6, 2025 07:25
Copilot finished work on behalf of kevwan November 6, 2025 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

go-stash支持自动生成时间戳吗

2 participants