Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The timestamp field is marked as persisted but it is not #19

Open
cneth opened this issue Feb 2, 2017 · 1 comment
Open

The timestamp field is marked as persisted but it is not #19

cneth opened this issue Feb 2, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@cneth
Copy link

cneth commented Feb 2, 2017

According to the help text, the 'timestamp' field is one of the items persisted. However, it does not actually work. It looks like that despite the comment in configuration.go about making sure to keep the CopyConfigRelevantSettingsTo contents in sync with the array of persisted flags, that didn't happen.

I believe the following patch solves the issues:

diff --git a/configuration.go b/configuration.go
index 573d8be..951672c 100644
--- a/configuration.go
+++ b/configuration.go
@@ -76,6 +76,7 @@ func (c *Configuration) CopyConfigRelevantSettingsTo(dest *Configuration) {
        dest.SearchTarget.Url = c.SearchTarget.Url
        dest.SearchTarget.IndexPattern = c.SearchTarget.IndexPattern
        dest.QueryDefinition.Format = c.QueryDefinition.Format
+       dest.QueryDefinition.TimestampField = c.QueryDefinition.TimestampField
        dest.QueryDefinition.Terms = make([]string, len(c.QueryDefinition.Terms))
        copy(dest.QueryDefinition.Terms, c.QueryDefinition.Terms)
        dest.User = c.User
@@ -84,7 +85,6 @@ func (c *Configuration) CopyConfigRelevantSettingsTo(dest *Configuration) {
 
 func (c *Configuration) CopyNonConfigRelevantSettingsTo(dest *Configuration) {
        //copy non-config relevant settings
-       dest.QueryDefinition.TimestampField = c.QueryDefinition.TimestampField
        dest.QueryDefinition.AfterDateTime = c.QueryDefinition.AfterDateTime
        dest.QueryDefinition.BeforeDateTime = c.QueryDefinition.BeforeDateTime
        dest.ListOnly = c.ListOnly
@knes1
Copy link
Owner

knes1 commented Feb 3, 2017

Hi! Thank you for noticing this and for sending over the patch. It looks good to me. I'll be merging this in over the weekend.

@knes1 knes1 added the bug label Feb 21, 2017
@knes1 knes1 self-assigned this Feb 21, 2017
@knes1 knes1 added this to the v0.1.8 milestone Feb 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants