Skip to content

Instantly share code, notes, and snippets.

@wrossmann
Created January 29, 2020 01:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wrossmann/875c4018a81f084fa90497dd67f945c8 to your computer and use it in GitHub Desktop.
Save wrossmann/875c4018a81f084fa90497dd67f945c8 to your computer and use it in GitHub Desktop.
Find all Graylog output mappings

There doesn't seem to be a UI function for this, so if you're stuck up a creek like I am.

curl -s \
    -H "Authorization: Basic $(echo -n 'username:password' | base64)" \
    http://graylog-server:9000/api/streams \
| jq '
.streams[] | 
select(.outputs | length > 0) | 
{
    id: .id,
    title: .title,
    outputs: [(
        .outputs[] | {id: .id, title: .title}
    )]
}'

You'll end up with a minimal JSON doc with the names and IDs of all the streams, and all the outputs mapped to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment