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

Slack output breaks when there are linebreaks in the attachments' fields #13

Open
ryudice opened this issue Aug 27, 2018 · 1 comment · May be fixed by #18
Open

Slack output breaks when there are linebreaks in the attachments' fields #13

ryudice opened this issue Aug 27, 2018 · 1 comment · May be fixed by #18

Comments

@ryudice
Copy link

ryudice commented Aug 27, 2018

  • 6.0.1
  • Docker running on Ubuntu

Config file


	slack {
			url =>"https://something"
			username => "slack-output-test"
			format => "%{[docker][labels][io_rancher_project_name]} "
			attachments => [
				{
					color =>  "good"
					pretext => "%{message}"
					fields => [
						{ rancher_stack => "%{[docker][labels][io_rancher_project_name]}" }
					]
				}

			]
		}

Sample data

Any thing that contains a linebreak in the message field breaks it.

Error from logstash log

 An unexpected error occurred! {:error=>#<JSON::ParserError: unexpected token at '{"color":"good","pretext":"System.ArgumentException: Requested value 'chabelosite' was not found.
8/27/2018 1:18:28 PM   at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
8/27/2018 1:18:28 PM   at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
8/27/2018 1:18:28 PM   at Saongroup.TechIntegration.Common.MVC.SiteRequestModelBinder.GetRequestType(String site, Type baseRequestType)
8/27/2018 1:18:28 PM   at Saongroup.TechIntegration.Common.MVC.SiteRequestModelBinder.BindModelAsync(ModelBindingContext bindingContext)
8/27/2018 1:18:28 PM   at Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinder.BindModelAsync(ActionContext actionContext, IModelBinder modelBinder, IValueProvider valueProvider, ParameterDescriptor parameter, ModelMetadata metadata, Object value)
8/27/2018 1:18:28 PM   at Microsoft.AspNetCore.Mvc.Internal.ControllerBinderDelegateProvider.<>c__DisplayClass0_0.<<CreateBinderDelegate>g__Bind|0>d.MoveNext()
8/27/2018 1:18:28 PM--- End of stack trace from previous location where exception was thrown ---
8/27/2018 1:18:28 PM   at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeInnerFilterAsync()
8/27/2018 1:18:28 PM   at Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.InvokeNextExceptionFilterAsync()","fields":[{"rancher_stack":"gdpr-rtbf-deploy-dev"}]}'>
@simonare
Copy link

I am also getting same error. Any solution for this error? I

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants