version: '3.2'
services:
   rsyslog:
      image: webratio/rsyslog-docker:8.18
      container_name: rsyslogd
      volumes:
          - /var/log/docker:/var/log/
      ports:
          - "10514:10514/udp"
      restart: always

version: '3.0'
services:
   rsyslog:
      image: webratio/rsyslog-docker:8.18
      container_name: rsyslogd
      volumes:
          - /var/log/docker:/var/log/
      ports:
          - "10514:10514/udp"
      restart: always

Change version from 3.2 to 3.0 for docker compose
Change version from 3.2 to 3.0 for docker compose