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

Detection of malformed json #5

Closed
olref opened this issue Feb 20, 2016 · 1 comment
Closed

Detection of malformed json #5

olref opened this issue Feb 20, 2016 · 1 comment

Comments

@olref
Copy link

olref commented Feb 20, 2016

When the migration_config.json file is not valid (for example you add a comma at a wrong place ;-) )
there are no warning from the tool.

Example of a file that caused me a problem (it took me some minutes to find why migrator doesn't understand my pattern) :

[
  {
    "pattern": "TEST.2013.#TEXT1.#TEXT2",
    "measurement": "#TEXT2",
    "tags": [
      {
        "tagkey": "host",
        "tagvalue": "#TEXT1"
      }
    ],
    "field": "value"
  },
]

It could be a great help, if the migration tool return a warning when it can't parse the json.

Perhaps is it possible to get error returned by json.Unmarshal and display it as a warning (into the function ReadTagConfig)

err = json.Unmarshal(raw, &migrationData.tagConfigs)
if err != nil {
  fmt.Printf("Can not parse migration_config.json : %s", err)
}

Thanks for this tool, it will be very useful !

@uttamgandhi
Copy link
Contributor

Thanks for identifying this issue.

I have created a pull request, to handle this request
#8

If you are keen to have a look you take the feature branch

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

No branches or pull requests

2 participants