How can I filter out logs in the termial?

I'm using Elasticsearch in my Node.js app - is there any possibility to filter out the logs that are showing in the terminal? For example, show only errors, warnings.


I'm running the application via docker-compose and the following env variable didn't work:

- logger.action.level=error

docker-compose.yml:

   elasticsearch:
        container_name: elasticsearch
        image: docker.elastic.co/elasticsearch/elasticsearch:7.4.2
        volumes:
            - esdata:/usr/share/elasticsearch/data
        environment:
            - logger.action.level=error
            - discovery.type=single-node
        ports:
            - 9200:9200
            - 9300:9300
        networks: 
            - elastic