Skip to content

Instantly share code, notes, and snippets.

@kth5
Last active April 28, 2022 09:48
Show Gist options
  • Save kth5/d3a029e65cf180956b526fd3f9a52e36 to your computer and use it in GitHub Desktop.
Save kth5/d3a029e65cf180956b526fd3f9a52e36 to your computer and use it in GitHub Desktop.
Graylog - Application controlled timestamp with override allowed enabled (tested w/ Graylog >=3.1.4)
{
"v": 1,
"id": "7a8b396e-e9b9-40c1-97ea-a60ebbb58e62",
"rev": 1,
"name": "Graylog - Custom Timestamp ",
"summary": "Application controlled timestamp",
"description": "This allows the application to log a time that Graylog will then reflect in its native timestamp field. This is great for sorting and the like.\n\nThe advantage of doing it this way is that we can leave the override enabled on the extractor should the actual timestamp in the message not be parseable, yet preserve the timestamp provided should it become necessary. Just swicth from Cut to Copy.",
"vendor": "kth5",
"url": "https://github.com/kth5",
"parameters": [],
"entities": [
{
"v": "1",
"type": {
"name": "input",
"version": "1"
},
"id": "514b1fb8-21b5-4b1e-b3c1-e532ceb43a25",
"data": {
"title": {
"@type": "string",
"@value": "amq-1"
},
"configuration": {
"broker_password": {
"@type": "string",
"@value": "s3cr3ts4uc3"
},
"exchange": {
"@type": "string",
"@value": "graylog-messages"
},
"routing_key": {
"@type": "string",
"@value": "#"
},
"broker_port": {
"@type": "integer",
"@value": 5672
},
"force_rdns": {
"@type": "boolean",
"@value": false
},
"allow_override_date": {
"@type": "boolean",
"@value": true
},
"throttling_allowed": {
"@type": "boolean",
"@value": true
},
"queue": {
"@type": "string",
"@value": "graylog-messages"
},
"expand_structured_data": {
"@type": "boolean",
"@value": false
},
"store_full_message": {
"@type": "boolean",
"@value": false
},
"requeue_invalid_messages": {
"@type": "boolean",
"@value": true
},
"prefetch": {
"@type": "integer",
"@value": 100
},
"broker_vhost": {
"@type": "string",
"@value": "/"
},
"exchange_bind": {
"@type": "boolean",
"@value": true
},
"broker_hostname": {
"@type": "string",
"@value": "amq-1.tld"
},
"parallel_queues": {
"@type": "integer",
"@value": 5
},
"tls": {
"@type": "boolean",
"@value": false
},
"heartbeat": {
"@type": "integer",
"@value": 60
},
"broker_username": {
"@type": "string",
"@value": "fluentd"
}
},
"static_fields": {},
"type": {
"@type": "string",
"@value": "org.graylog2.inputs.syslog.amqp.SyslogAMQPInput"
},
"global": {
"@type": "boolean",
"@value": true
},
"extractors": [
{
"target_field": {
"@type": "string",
"@value": "timestamp"
},
"condition_value": {
"@type": "string",
"@value": ""
},
"order": {
"@type": "integer",
"@value": 0
},
"converters": [
{
"type": {
"@type": "string",
"@value": "DATE"
},
"configuration": {
"date_format": {
"@type": "string",
"@value": "yyyy-MM-dd'T'HH:mm:ss.SSSZ"
},
"time_zone": {
"@type": "string",
"@value": "Etc/UTC"
},
"locale": {
"@type": "string",
"@value": "en-US-POSIX"
}
}
}
],
"configuration": {},
"source_field": {
"@type": "string",
"@value": "app_timestamp"
},
"title": {
"@type": "string",
"@value": "Custom Timestamp"
},
"type": {
"@type": "string",
"@value": "COPY_INPUT"
},
"cursor_strategy": {
"@type": "string",
"@value": "COPY"
},
"condition_type": {
"@type": "string",
"@value": "NONE"
}
}
]
},
"constraints": [
{
"type": "server-version",
"version": ">=4.2.7+879e651"
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment