title: anyone know how to add alert rules in TDengine?
body: <p>TDengine provides a utility named alert to provide alerting function via AlertManger.</p>
  <p>I'm confused how to add multiple alert rules?</p>
  <p>I'm running as below:</p>
  <pre><code>[root@bogon TDengine-alert]# ./alert -cfg alert.cfg
  2021-12-01T17:11:35.827+0800 INFO log/log.go:44 upgrading database to version: 0
  2021-12-01T17:11:35.854+0800 INFO log/log.go:49 total 0 rules loaded
  2021-12-01T17:11:35.855+0800 INFO log/log.go:44 Listening at port: 8100
  2021-12-01T17:11:55.281+0800 ERROR log/log.go:64 failed to parse rule: invalid character 'ã' looking for beginning of object key string
  github.com/taosdata/alert/utils/log.Error
  /home/ubuntu/workroom/jenkins/TDinternal/community/alert/utils/log/log.go:64
  github.com/taosdata/alert/app.onUpdateRule
  /home/ubuntu/workroom/jenkins/TDinternal/community/alert/app/app.go:78
  net/http.HandlerFunc.ServeHTTP
  /home/ubuntu/soft/go/src/net/http/server.go:2042
  net/http.(*ServeMux).ServeHTTP
  /home/ubuntu/soft/go/src/net/http/server.go:2417
  main.(*httpHandler).ServeHTTP
  /home/ubuntu/workroom/jenkins/TDinternal/community/alert/cmd/alert/main.go:31
  net/http.serverHandler.ServeHTTP
  /home/ubuntu/soft/go/src/net/http/server.go:2843
  net/http.(*conn).serve
  /home/ubuntu/soft/go/src/net/http/server.go:1925
  2021-12-01T17:11:55.281+0800 DEBUG log/log.go:39 [POST] /api/update-rule 1.113836ms
  ^C'Ctrl + C' received, exiting...
  2021-12-01T17:15:14.736+0800 ERROR log/log.go:64 http: Server closed
  github.com/taosdata/alert/utils/log.Error
  /home/ubuntu/workroom/jenkins/TDinternal/community/alert/utils/log/log.go:64
  main.serveWeb.func1
  /home/ubuntu/workroom/jenkins/TDinternal/community/alert/cmd/alert/main.go:45
  </code></pre>
  <p>After I added a few rules, it reports errors.</p>
  <p>[root@bogon TDengine-alert]# cat alert.cfg
  {
  &quot;port&quot;: 8100,
  &quot;database&quot;: &quot;file:alert.db&quot;,
  &quot;tdengine&quot;: &quot;root:root@/tcp(127.0.0.1:0)/&quot;,
  &quot;log&quot;: {
  &quot;level&quot;: &quot;debug&quot;,
  &quot;path&quot;: &quot;&quot;
  },
  &quot;receivers&quot;: {
  &quot;alertManager&quot;: &quot;http://127.0.0.1:9093/api/v1/alerts&quot;,
  &quot;console&quot;: true
  }
  }</p>
  <p>[root@bogon ruite]# cat rule.json</p>
  <pre><code>{
  　　&quot;name&quot;: &quot;d1001_50&quot;,
  　　&quot;sql&quot;: &quot;select avg(tdata) as avgVal from test.d1001 order by ts desc limit 50&quot;,
  　　&quot;expr&quot;: &quot;avgVal &gt; 50&quot;,
  　　&quot;for&quot;: &quot;10s&quot;,
  　　&quot;period&quot;: &quot;1s&quot;,
  　　&quot;labels&quot;: {
  　　　　&quot;ruleName&quot;: &quot;d1001_50&quot;
  　　},
  　　&quot;annotations&quot;: {
  　　　　&quot;summary&quot;: &quot;average value among devices: {{$values.avgVal}}&quot;
  　　}
  }
  </code></pre>
  <p>[root@bogon ruite]# curl -d '@rule.json' http://localhost:8100/api/update-rule
  [root@bogon ruite]# curl http://localhost:8100/api/list-rule
  null
  [root@bogon ruite]#</p>