How do we create an Event Definition with API browser?

Hello,

please tell me how to create an Event Definition with Graylog’s API browser http://127.0.0.1:9000/api/api-browser .

In case other resources such as User, we can input JSON body.
On the other hand, in case Event Definition there is no textarea.

When we try to click the button “Try it out!”, the following error occurs.

{
  "type": "ApiError",
  "message": "HTTP 415 Unsupported Media Type"
}

Is this a bug? Should I create an issue at https://github.com/Graylog2/graylog2-server/issues/new ?

Environment

I run Graylog with Docker Compose.

Graylog: v3.1.2

---
version: '2'
services:
  # MongoDB: https://hub.docker.com/_/mongo/
  mongodb:
    image: mongo:3
  # Elasticsearch: https://www.elastic.co/guide/en/elasticsearch/reference/6.6/docker.html
  elasticsearch:
    image: docker.elastic.co/elasticsearch/elasticsearch-oss:6.6.1
    environment:
      - http.host=0.0.0.0
      - transport.host=localhost
      - network.host=0.0.0.0
      - "ES_JAVA_OPTS=-Xms1024m -Xmx1024m"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    mem_limit: 1g
  # Graylog: https://hub.docker.com/r/graylog/graylog/
  graylog:
    image: graylog/graylog:3.1.2
    environment:
      # CHANGE ME (must be at least 16 characters)!
      - GRAYLOG_PASSWORD_SECRET=somepasswordpepper
      # Password: admin
      - GRAYLOG_ROOT_PASSWORD_SHA2=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
      - GRAYLOG_HTTP_EXTERNAL_URI=http://127.0.0.1:9000/
    links:
      - mongodb:mongo
      - elasticsearch
    depends_on:
      - mongodb
      - elasticsearch
    ports:
      # Graylog web interface and REST API
      - 9000:9000
      # Syslog TCP
      - 1514:1514
      # Syslog UDP
      - 1514:1514/udp
      # GELF TCP
      - 12201:12201
      # GELF UDP
      - 12201:12201/udp
    volumes:
      - ./plugin:/usr/share/graylog/plugin

Thank you.

2 Likes

I maintain the Terraform provider for Graylog.

So I want to know the Graylog’s API specification.
I usually use the API browser to know the API specification.
But I can’t create an Event Definition with the API browser.
So I created this topic.

Even if we can’t create an Event Definition with the API browser,
it is ok if I can know the specification of the create an Event Definition API.

Thank you.

3 Likes

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