Syntax error message in elasticsearch.yml


(yasin) #1

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

(David Turner) #2

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.


(yasin) #3

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!


(David Turner) #4

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.


(yasin) #5

Dear David,

Updated,please confirm.


(David Turner) #6

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

I think you are using this button:

04

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


(yasin) #7

Dear David,

Again thank you for your reply, how about now?


(David Turner) #8

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:
       ...

(yasin) #9

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?


(David Turner) #10

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


(yasin) #11

Dear David,

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

Please say it's ok please


(David Turner) #12

Fantastic, thanks, all fixed now.


(yasin) #13

Dear David,

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