Skip to content

Conversation

@sudo-suhas
Copy link
Contributor

  • Introduce and use template helper function on sample configs of
    sinks, extractors and processors to replace tabs, if present, with
    spaces in sample configs. If tabs are present, parsing the file as
    YAML fails.
  • Fix sample configs for sinks/http, extractors/{kafka, tableau}.
  • Reformat sample configs for consistency.

@sudo-suhas
Copy link
Contributor Author

@StewartJingga this issue is present in #408 as well. Can we review and merge this change?

- Introduce and use template helper function on sample configs of
  sinks, extractors and processors to replace tabs, if present, with
  spaces in sample configs. If tabs are present, parsing the file as
  YAML fails.
- Fix sample configs for sinks/http, extractors/{kafka, tableau}.
- Reformat sample configs for consistency.
return pad + strings.Replace(v, "\n", "\n"+pad, -1)
}

func fmtSampleConfig(s string) string {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sudo-suhas lets rename this to something short? maybe cfmt ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does rawfmt work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in #412, please check

@StewartJingga
Copy link
Contributor

StewartJingga commented Sep 13, 2022

Should we move sample config to its own file 🤔 ? or even better, maybe we should generate sample config from the Config struct itself. wdyt @ravisuhag @sudo-suhas

@StewartJingga
Copy link
Contributor

Should we move sample config to its own file 🤔 ? or even better, maybe we should generate sample config from the Config struct itself. wdyt @ravisuhag @sudo-suhas

We can keep current change for now, need more analysis and effort for generating from Config struct but I think it is possible. Just something to think about.

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.

4 participants