Syntax error message in elasticsearch.yml

Dear Team,

I'm trying to configure the slack notification but i'm always getting the following error message:
The YAML settings are invalid, please check your syntax
This error message is created after adding the message_default: from: xpack to:elk

xpack.notification.slack:
  account:
    monitoring:
      url: https://hooks.slack.com/services/
      from: xpack
      to: elk

Please don't post images of text. They're hard to search and can't be read by those of us using a screenreader. Instead, please use the </> button to format the text in your post.

Note that YAML is whitespace-sensitive, so you need to make sure that the keys all line up. In the screenshot you shared the from and to keys are not in line with each other.

i'm terrible sorry, is this ok now?

I was able to resolve the issue with the reply you give me. Thank you so much!

Love Elastic!

1 Like

No problem. However, the edit you have made didn't fix it. You need to replace the screenshot with the actual text, using the </> button to format it to look like code and to preserve whitespace. Check the preview window on the right to make sure it looks good.

The source of your post will look something like this:

```
xpack.notification.slack:
   account:
     monitoring:
       ...
```

Note the backticks around the pre-formatted text.

Dear David,

Updated,please confirm.

It now looks like this to me, which still isn't correctly formatted:

18

I think you are using this button:

04

Try using the button that looks like </> instead.

Dear David,

Again thank you for your reply, how about now?

Ok, that's the right button now, but it's still formatted wrong for me. I think it's all ended up on one line for some reason. Can you paste the YAML file into the box, check that it is split across multiple lines and includes all the spaces, and then select everything you just pasted and hit </>? It'll look like this in the preview:

xpack.notification.slack:
   account:
     monitoring:
       ...

Dear David,

I was just giving up and found it :smiley: well bloody hell :slight_smile:
Seems like i first needed to select the text to have in that bloc.
Can you please check and confirm?

Almost! It's just missing the vital leading spaces, so everything is over on the left hand side. The spaces are important in YAML.

Dear David,

Forgot t copy my correct setting, now i've pasted it.

Please say it's ok please

Fantastic, thanks, all fixed now.

Dear David,

You're Fantastic to.Thank you very much!!!

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.