Send log data by API in Graylog


I need to send data/logs by API from a (linux) monitoring server.

I did not find a Graylog API do achieve this in the Graylog documentation.
“Inputs” are data sources, but what i really want to do is push log data to Graylog.

However, there is an Elasticsearch API to achieve this:
curl -X POST http://myserver:9200/idx_name/type_name -H ‘cache-control: no-cache’ -H ‘content-type: application/json’ -d ‘@’./output.json

Elasticsearch then responds somthing pretty optimistic:

However I don’t find my log when searching in the stream in Graylog.

So my questions are:

  • Is there a Graylog API to push log data ?
  • Is is (ro NOT) recommended to use Elasticsearch API (and therefore bypassing Graylog) ?



Yes. It’s called inputs. :wink:

Using a GELF HTTP probably brings you closest to what you want to achieve (if you really want to use HTTP as a transport protocol).
See for some examples.

No, that’s neither recommended nor is it easily possible.

1 Like

Hi Jochen.

Thanks a lot, it does what is needed !

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