View | Details | Raw Unified | Return to bug 216593 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-6 / +15 lines)
Lines 2-11 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	graylog
4
PORTNAME=	graylog
5
PORTVERSION=	1.3.3
5
PORTVERSION=	2.1.2
6
CATEGORIES=	sysutils java
6
CATEGORIES=	sysutils java
7
MASTER_SITES=	https://packages.graylog2.org/releases/graylog2-server/ \
7
MASTER_SITES=	https://packages.graylog2.org/releases/graylog/ \
8
		http://packages.graylog2.org/releases/graylog2-server/
8
		http://packages.graylog2.org/releases/graylog/
9
9
10
MAINTAINER=	thomas@bartelmess.io
10
MAINTAINER=	thomas@bartelmess.io
11
COMMENT=	Tool for centralized log collection
11
COMMENT=	Tool for centralized log collection
Lines 22-44 Link Here
22
GRAYLOG_DIR=	${PREFIX}/${PORTNAME}
22
GRAYLOG_DIR=	${PREFIX}/${PORTNAME}
23
23
24
USE_RC_SUBR=	graylog
24
USE_RC_SUBR=	graylog
25
SUB_FILES=	server.conf.sample pkg-message
25
26
26
GRAYLOGUSER?=	graylog
27
GRAYLOGUSER?=	graylog
27
GRAYLOGGROUP?=	${GRAYLOGUSER}
28
GRAYLOGGROUP?=	${GRAYLOGUSER}
28
USERS=		${GRAYLOGUSER}
29
USERS=		${GRAYLOGUSER}
29
GROUPS=		${GRAYLOGGROUP}
30
GROUPS=		${GRAYLOGGROUP}
31
GRAYLOG_DATA_DIR=	/var/db/graylog
30
32
31
SUB_LIST=	GRAYLOGUSER=${GRAYLOGUSER} \
33
SUB_LIST=	GRAYLOGUSER=${GRAYLOGUSER} \
32
		GRAYLOGGROUP=${GRAYLOGGROUP} \
34
		GRAYLOGGROUP=${GRAYLOGGROUP} \
33
		JAVA_HOME=${JAVA_HOME} \
35
		JAVA_HOME=${JAVA_HOME} \
34
		GRAYLOG_DIR=${GRAYLOG_DIR} \
36
		GRAYLOG_DIR=${GRAYLOG_DIR} \
37
		ETCDIR=${ETCDIR} \
38
		GRAYLOG_DATA_DIR=${GRAYLOG_DATA_DIR}
39
40
PLIST_SUB=	GRAYLOG_DATA_DIR=${GRAYLOG_DATA_DIR} \
41
		GRAYLOGUSER=${GRAYLOGUSER} \
42
		GRAYLOGGROUP=${GRAYLOGGROUP} \
35
		ETCDIR=${ETCDIR}
43
		ETCDIR=${ETCDIR}
36
44
37
do-install:
45
do-install:
38
	${MKDIR} ${STAGEDIR}${GRAYLOG_DIR}
46
	${MKDIR} ${STAGEDIR}${GRAYLOG_DIR}
39
	${MKDIR} ${STAGEDIR}${ETCDIR}
47
	${MKDIR} ${STAGEDIR}${ETCDIR}/server
48
	${MKDIR} ${GRAYLOG_DATA_DIR}
40
	${INSTALL_DATA} ${WRKSRC}/graylog.jar ${STAGEDIR}${GRAYLOG_DIR}
49
	${INSTALL_DATA} ${WRKSRC}/graylog.jar ${STAGEDIR}${GRAYLOG_DIR}
41
	${INSTALL_DATA} ${WRKSRC}/graylog.conf.example ${STAGEDIR}${ETCDIR}
50
	(cd ${WRKSRC}/plugin && ${COPYTREE_SHARE} . ${STAGEDIR}${GRAYLOG_DIR}/plugin)
42
	${INSTALL_DATA} ${FILESDIR}/graylog_logging.xml ${STAGEDIR}${ETCDIR}
51
	${INSTALL_DATA} ${WRKDIR}/server.conf.sample ${STAGEDIR}${ETCDIR}/server/server.conf.sample
43
52
44
.include <bsd.port.mk>
53
.include <bsd.port.mk>
(-)distinfo (-2 / +3 lines)
Lines 1-2 Link Here
1
SHA256 (graylog-1.3.3.tgz) = 1e98509376dc22ff1602838cebb49b4732618296acc58063ba34f4a97f667ba0
1
TIMESTAMP = 1485721441
2
SIZE (graylog-1.3.3.tgz) = 70204863
2
SHA256 (graylog-2.1.2.tgz) = 5d653467fb18fdd58b261598dc820f90d48e2018e7cd8d9f103003a0070d954b
3
SIZE (graylog-2.1.2.tgz) = 94284738
(-)files/graylog.conf.example (-376 lines)
Lines 1-376 Link Here
1
# If you are running more than one instances of graylog2-server you have to select one of these
2
# instances as master. The master will perform some periodical tasks that non-masters won't perform.
3
is_master = true
4
5
# The auto-generated node ID will be stored in this file and read after restarts. It is a good idea
6
# to use an absolute file path here if you are starting graylog2-server from init scripts or similar.
7
node_id_file = /var/graylog/server/node-id
8
9
# You MUST set a secret to secure/pepper the stored user passwords here. Use at least 64 characters.
10
# Generate one by using for example: pwgen -N 1 -s 96
11
password_secret =
12
13
# The default root user is named 'admin'
14
#root_username = admin
15
16
# You MUST specify a hash password for the root user (which you only need to initially set up the
17
# system and in case you lose connectivity to your authentication backend)
18
# This password cannot be changed using the API or via the web interface. If you need to change it,
19
# modify it in this file.
20
# Create one by using for example: echo -n yourpassword | shasum -a 256
21
# and put the resulting hash value into the following line
22
root_password_sha2 =
23
24
# The email address of the root user.
25
# Default is empty
26
#root_email = ""
27
28
# The time zone setting of the root user.
29
# Default is UTC
30
#root_timezone = UTC
31
32
# Set plugin directory here (relative or absolute)
33
plugin_dir = plugin
34
35
# REST API listen URI. Must be reachable by other graylog2-server nodes if you run a cluster.
36
rest_listen_uri = http://127.0.0.1:12900/
37
38
# REST API transport address. Defaults to the value of rest_listen_uri. Exception: If rest_listen_uri
39
# is set to a wildcard IP address (0.0.0.0) the first non-loopback IPv4 system address is used.
40
# If set, his will be promoted in the cluster discovery APIs, so other nodes may try to connect on
41
# this address and it is used to generate URLs addressing entities in the REST API. (see rest_listen_uri)
42
# You will need to define this, if your Graylog server is running behind a HTTP proxy that is rewriting
43
# the scheme, host name or URI.
44
#rest_transport_uri = http://192.168.1.1:12900/
45
46
# Enable CORS headers for REST API. This is necessary for JS-clients accessing the server directly.
47
# If these are disabled, modern browsers will not be able to retrieve resources from the server.
48
# This is disabled by default. Uncomment the next line to enable it.
49
#rest_enable_cors = true
50
51
# Enable GZIP support for REST API. This compresses API responses and therefore helps to reduce
52
# overall round trip times. This is disabled by default. Uncomment the next line to enable it.
53
#rest_enable_gzip = true
54
55
# Enable HTTPS support for the REST API. This secures the communication with the REST API with
56
# TLS to prevent request forgery and eavesdropping. This is disabled by default. Uncomment the
57
# next line to enable it.
58
#rest_enable_tls = true
59
60
# The X.509 certificate file to use for securing the REST API.
61
#rest_tls_cert_file = /path/to/graylog2.crt
62
63
# The private key to use for securing the REST API.
64
#rest_tls_key_file = /path/to/graylog2.key
65
66
# The password to unlock the private key used for securing the REST API.
67
#rest_tls_key_password = secret
68
69
# The maximum size of a single HTTP chunk in bytes.
70
#rest_max_chunk_size = 8192
71
72
# The maximum size of the HTTP request headers in bytes.
73
#rest_max_header_size = 8192
74
75
# The maximal length of the initial HTTP/1.1 line in bytes.
76
#rest_max_initial_line_length = 4096
77
78
# The size of the execution handler thread pool used exclusively for serving the REST API.
79
#rest_thread_pool_size = 16
80
81
# The size of the worker thread pool used exclusively for serving the REST API.
82
#rest_worker_threads_max_pool_size = 16
83
84
# Embedded Elasticsearch configuration file
85
# pay attention to the working directory of the server, maybe use an absolute path here
86
#elasticsearch_config_file = /usr/local/etc/graylog/server/elasticsearch.yml
87
88
# Graylog will use multiple indices to store documents in. You can configured the strategy it uses to determine
89
# when to rotate the currently active write index.
90
# It supports multiple rotation strategies:
91
#   - "count" of messages per index, use elasticsearch_max_docs_per_index below to configure
92
#   - "size" per index, use elasticsearch_max_size_per_index below to configure
93
# valid values are "count", "size" and "time", default is "count"
94
rotation_strategy = count
95
96
# (Approximate) maximum number of documents in an Elasticsearch index before a new index
97
# is being created, also see no_retention and elasticsearch_max_number_of_indices.
98
# Configure this if you used 'rotation_strategy = count' above.
99
elasticsearch_max_docs_per_index = 20000000
100
101
# (Approximate) maximum size in bytes per Elasticsearch index on disk before a new index is being created, also see
102
# no_retention and elasticsearch_max_number_of_indices. Default is 1GB.
103
# Configure this if you used 'rotation_strategy = size' above.
104
#elasticsearch_max_size_per_index = 1073741824
105
106
# (Approximate) maximum time before a new Elasticsearch index is being created, also see
107
# no_retention and elasticsearch_max_number_of_indices. Default is 1 day.
108
# Configure this if you used 'rotation_strategy = time' above.
109
# Please note that this rotation period does not look at the time specified in the received messages, but is
110
# using the real clock value to decide when to rotate the index!
111
# Specify the time using a duration and a suffix indicating which unit you want:
112
#  1w  = 1 week
113
#  1d  = 1 day
114
#  12h = 12 hours
115
# Permitted suffixes are: d for day, h for hour, m for minute, s for second.
116
#elasticsearch_max_time_per_index = 1d
117
118
# Disable checking the version of Elasticsearch for being compatible with this Graylog release.
119
# WARNING: Using Graylog with unsupported and untested versions of Elasticsearch may lead to data loss!
120
#elasticsearch_disable_version_check = true
121
122
# Disable message retention on this node, i. e. disable Elasticsearch index rotation.
123
#no_retention = false
124
125
# How many indices do you want to keep?
126
elasticsearch_max_number_of_indices = 20
127
128
# Decide what happens with the oldest indices when the maximum number of indices is reached.
129
# The following strategies are availble:
130
#   - delete # Deletes the index completely (Default)
131
#   - close # Closes the index and hides it from the system. Can be re-opened later.
132
retention_strategy = delete
133
134
# How many Elasticsearch shards and replicas should be used per index? Note that this only applies to newly created indices.
135
elasticsearch_shards = 4
136
elasticsearch_replicas = 0
137
138
# Prefix for all Elasticsearch indices and index aliases managed by Graylog.
139
elasticsearch_index_prefix = graylog2
140
141
# Do you want to allow searches with leading wildcards? This can be extremely resource hungry and should only
142
# be enabled with care. See also: https://www.graylog.org/documentation/general/queries/
143
allow_leading_wildcard_searches = false
144
145
# Do you want to allow searches to be highlighted? Depending on the size of your messages this can be memory hungry and
146
# should only be enabled after making sure your Elasticsearch cluster has enough memory.
147
allow_highlighting = false
148
149
# settings to be passed to elasticsearch's client (overriding those in the provided elasticsearch_config_file)
150
# all these
151
# this must be the same as for your Elasticsearch cluster
152
#elasticsearch_cluster_name = graylog2
153
154
# you could also leave this out, but makes it easier to identify the graylog2 client instance
155
#elasticsearch_node_name = graylog2-server
156
157
# we don't want the graylog2 server to store any data, or be master node
158
#elasticsearch_node_master = false
159
#elasticsearch_node_data = false
160
161
# use a different port if you run multiple Elasticsearch nodes on one machine
162
#elasticsearch_transport_tcp_port = 9350
163
164
# we don't need to run the embedded HTTP server here
165
#elasticsearch_http_enabled = false
166
167
#elasticsearch_discovery_zen_ping_multicast_enabled = false
168
#elasticsearch_discovery_zen_ping_unicast_hosts = 192.168.1.203:9300
169
170
# Change the following setting if you are running into problems with timeouts during Elasticsearch cluster discovery.
171
# The setting is specified in milliseconds, the default is 5000ms (5 seconds).
172
#elasticsearch_cluster_discovery_timeout = 5000
173
174
# the following settings allow to change the bind addresses for the Elasticsearch client in graylog2
175
# these settings are empty by default, letting Elasticsearch choose automatically,
176
# override them here or in the 'elasticsearch_config_file' if you need to bind to a special address
177
# refer to http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/modules-network.html
178
# for special values here
179
#elasticsearch_network_host =
180
#elasticsearch_network_bind_host =
181
#elasticsearch_network_publish_host =
182
183
# The total amount of time discovery will look for other Elasticsearch nodes in the cluster
184
# before giving up and declaring the current node master.
185
#elasticsearch_discovery_initial_state_timeout = 3s
186
187
# Analyzer (tokenizer) to use for message and full_message field. The "standard" filter usually is a good idea.
188
# All supported analyzers are: standard, simple, whitespace, stop, keyword, pattern, language, snowball, custom
189
# Elasticsearch documentation: http://www.elasticsearch.org/guide/reference/index-modules/analysis/
190
# Note that this setting only takes effect on newly created indices.
191
elasticsearch_analyzer = standard
192
193
# Batch size for the Elasticsearch output. This is the maximum (!) number of messages the Elasticsearch output
194
# module will get at once and write to Elasticsearch in a batch call. If the configured batch size has not been
195
# reached within output_flush_interval seconds, everything that is available will be flushed at once. Remember
196
# that every outputbuffer processor manages its own batch and performs its own batch write calls.
197
# ("outputbuffer_processors" variable)
198
output_batch_size = 500
199
200
# Flush interval (in seconds) for the Elasticsearch output. This is the maximum amount of time between two
201
# batches of messages written to Elasticsearch. It is only effective at all if your minimum number of messages
202
# for this time period is less than output_batch_size * outputbuffer_processors.
203
output_flush_interval = 1
204
205
# As stream outputs are loaded only on demand, an output which is failing to initialize will be tried over and
206
# over again. To prevent this, the following configuration options define after how many faults an output will
207
# not be tried again for an also configurable amount of seconds.
208
output_fault_count_threshold = 5
209
output_fault_penalty_seconds = 30
210
211
# The number of parallel running processors.
212
# Raise this number if your buffers are filling up.
213
processbuffer_processors = 5
214
outputbuffer_processors = 3
215
216
#outputbuffer_processor_keep_alive_time = 5000
217
#outputbuffer_processor_threads_core_pool_size = 3
218
#outputbuffer_processor_threads_max_pool_size = 30
219
220
# UDP receive buffer size for all message inputs (e. g. SyslogUDPInput).
221
#udp_recvbuffer_sizes = 1048576
222
223
# Wait strategy describing how buffer processors wait on a cursor sequence. (default: sleeping)
224
# Possible types:
225
#  - yielding
226
#     Compromise between performance and CPU usage.
227
#  - sleeping
228
#     Compromise between performance and CPU usage. Latency spikes can occur after quiet periods.
229
#  - blocking
230
#     High throughput, low latency, higher CPU usage.
231
#  - busy_spinning
232
#     Avoids syscalls which could introduce latency jitter. Best when threads can be bound to specific CPU cores.
233
processor_wait_strategy = blocking
234
235
# Size of internal ring buffers. Raise this if raising outputbuffer_processors does not help anymore.
236
# For optimum performance your LogMessage objects in the ring buffer should fit in your CPU L3 cache.
237
# Start server with --statistics flag to see buffer utilization.
238
# Must be a power of 2. (512, 1024, 2048, ...)
239
ring_size = 65536
240
241
inputbuffer_ring_size = 65536
242
inputbuffer_processors = 2
243
inputbuffer_wait_strategy = blocking
244
245
# Enable the disk based message journal.
246
message_journal_enabled = true
247
248
# The directory which will be used to store the message journal. The directory must me exclusively used by Graylog and
249
# must not contain any other files than the ones created by Graylog itself.
250
message_journal_dir = data/journal
251
252
# Journal hold messages before they could be written to Elasticsearch.
253
# For a maximum of 12 hours or 5 GB whichever happens first.
254
# During normal operation the journal will be smaller.
255
#message_journal_max_age = 12h
256
#message_journal_max_size = 5gb
257
258
#message_journal_flush_age = 1m
259
#message_journal_flush_interval = 1000000
260
#message_journal_segment_age = 1h
261
#message_journal_segment_size = 100mb
262
263
# Number of threads used exclusively for dispatching internal events. Default is 2.
264
#async_eventbus_processors = 2
265
266
# EXPERIMENTAL: Dead Letters
267
# Every failed indexing attempt is logged by default and made visible in the web-interface. You can enable
268
# the experimental dead letters feature to write every message that was not successfully indexed into the
269
# MongoDB "dead_letters" collection to make sure that you never lose a message. The actual writing of dead
270
# letter should work fine already but it is not heavily tested yet and will get more features in future
271
# releases.
272
dead_letters_enabled = false
273
274
# How many seconds to wait between marking node as DEAD for possible load balancers and starting the actual
275
# shutdown process. Set to 0 if you have no status checking load balancers in front.
276
lb_recognition_period_seconds = 3
277
278
# Every message is matched against the configured streams and it can happen that a stream contains rules which
279
# take an unusual amount of time to run, for example if its using regular expressions that perform excessive backtracking.
280
# This will impact the processing of the entire server. To keep such misbehaving stream rules from impacting other
281
# streams, Graylog limits the execution time for each stream.
282
# The default values are noted below, the timeout is in milliseconds.
283
# If the stream matching for one stream took longer than the timeout value, and this happened more than "max_faults" times
284
# that stream is disabled and a notification is shown in the web interface.
285
#stream_processing_timeout = 2000
286
#stream_processing_max_faults = 3
287
288
# Length of the interval in seconds in which the alert conditions for all streams should be checked
289
# and alarms are being sent.
290
#alert_check_interval = 60
291
292
# Since 0.21 the graylog2 server supports pluggable output modules. This means a single message can be written to multiple
293
# outputs. The next setting defines the timeout for a single output module, including the default output module where all
294
# messages end up.
295
#
296
# Time in milliseconds to wait for all message outputs to finish writing a single message.
297
#output_module_timeout = 10000
298
299
# Time in milliseconds after which a detected stale master node is being rechecked on startup.
300
#stale_master_timeout = 2000
301
302
# Time in milliseconds which Graylog is waiting for all threads to stop on shutdown.
303
#shutdown_timeout = 30000
304
305
# MongoDB Configuration
306
mongodb_useauth = false
307
#mongodb_user = grayloguser
308
#mongodb_password = 123
309
mongodb_host = 127.0.0.1
310
#mongodb_replica_set = localhost:27017,localhost:27018,localhost:27019
311
mongodb_database = graylog2
312
mongodb_port = 27017
313
314
# Raise this according to the maximum connections your MongoDB server can handle if you encounter MongoDB connection problems.
315
mongodb_max_connections = 100
316
317
# Number of threads allowed to be blocked by MongoDB connections multiplier. Default: 5
318
# If mongodb_max_connections is 100, and mongodb_threads_allowed_to_block_multiplier is 5, then 500 threads can block. More than that and an exception will be thrown.
319
# http://api.mongodb.org/java/current/com/mongodb/MongoOptions.html#threadsAllowedToBlockForConnectionMultiplier
320
mongodb_threads_allowed_to_block_multiplier = 5
321
322
# Drools Rule File (Use to rewrite incoming log messages)
323
# See: https://www.graylog.org/documentation/general/rewriting/
324
#rules_file = /usr/local/etc/graylog/server/rules.drl
325
326
# Email transport
327
#transport_email_enabled = false
328
#transport_email_hostname = mail.example.com
329
#transport_email_port = 587
330
#transport_email_use_auth = true
331
#transport_email_use_tls = true
332
#transport_email_use_ssl = true
333
#transport_email_auth_username = you@example.com
334
#transport_email_auth_password = secret
335
#transport_email_subject_prefix = [graylog2]
336
#transport_email_from_email = graylog2@example.com
337
338
# Specify and uncomment this if you want to include links to the stream in your stream alert mails.
339
# This should define the fully qualified base url to your web interface exactly the same way as it is accessed by your users.
340
#transport_email_web_interface_url = https://graylog2.example.com
341
342
# HTTP proxy for outgoing HTTP calls
343
#http_proxy_uri =
344
345
# Disable the optimization of Elasticsearch indices after index cycling. This may take some load from Elasticsearch
346
# on heavily used systems with large indices, but it will decrease search performance. The default is to optimize
347
# cycled indices.
348
#disable_index_optimization = true
349
350
# Optimize the index down to <= index_optimization_max_num_segments. A higher number may take some load from Elasticsearch
351
# on heavily used systems with large indices, but it will decrease search performance. The default is 1.
352
#index_optimization_max_num_segments = 1
353
354
# Disable the index range calculation on all open/available indices and only calculate the range for the latest
355
# index. This may speed up index cycling on systems with large indices but it might lead to wrong search results
356
# in regard to the time range of the messages (i. e. messages within a certain range may not be found). The default
357
# is to calculate the time range on all open/available indices.
358
#disable_index_range_calculation = true
359
360
# The threshold of the garbage collection runs. If GC runs take longer than this threshold, a system notification
361
# will be generated to warn the administrator about possible problems with the system. Default is 1 second.
362
#gc_warning_threshold = 1s
363
364
# Connection timeout for a configured LDAP server (e. g. ActiveDirectory) in milliseconds.
365
#ldap_connection_timeout = 2000
366
367
# https://github.com/bazhenov/groovy-shell-server
368
#groovy_shell_enable = false
369
#groovy_shell_port = 6789
370
371
# Enable collection of Graylog-related metrics into MongoDB
372
#enable_metrics_collection = false
373
374
# Disable the use of SIGAR for collecting system stats
375
#disable_sigar = false
376
(-)files/graylog.in (-24 / +32 lines)
Lines 34-50 Link Here
34
#   Default value: %%GRAYLOG_DIR%%
34
#   Default value: %%GRAYLOG_DIR%%
35
#   Path the the graylog installation.
35
#   Path the the graylog installation.
36
#
36
#
37
# graylog_data_dir (string):
38
#   Default vaule: %%GRAYLOG_DATA_DIR%%
39
#   Storage location for the graylog journal
40
#
37
# graylog_run_dir (string):
41
# graylog_run_dir (string):
38
#   Default value: /var/graylog
42
#   Default value: /var/graylog
39
#   Path the the graylog run folder.
43
#   Path the the graylog run folder.
40
#
44
#
41
# graylog_java_home (string):
45
# graylog_log_file (string):
42
#   Default value: %%JAVA_HOME%%
46
#   Default value: /var/log/graylog-server.conf
43
#   Root directory of the desired Java SDK.
47
#   Path for the Graylog Server logfile
44
#
45
# graylog_log4j_config (string):
46
#   Default value: file://%%ETCDIR%%/graylog_logging.xml
47
#   Path to the log4j configuration file for graylog
48
48
49
. /etc/rc.subr
49
. /etc/rc.subr
50
50
Lines 55-67 Link Here
55
: ${graylog_enable:="NO"}
55
: ${graylog_enable:="NO"}
56
: ${graylog_user:="%%GRAYLOGUSER%%"}
56
: ${graylog_user:="%%GRAYLOGUSER%%"}
57
: ${graylog_group:="%%GRAYLOGGROUP%%"}
57
: ${graylog_group:="%%GRAYLOGGROUP%%"}
58
: ${graylog_config:="%%ETCDIR%%/${name}.conf"}
58
: ${graylog_config:="%%ETCDIR%%/server/server.conf"}
59
: ${graylog_min_mem:="256m"}
59
: ${graylog_min_mem:="256m"}
60
: ${graylog_max_mem:="1g"}
60
: ${graylog_max_mem:="1g"}
61
: ${graylog_dir:="%%GRAYLOG_DIR%%"}
61
: ${graylog_dir:="%%GRAYLOG_DIR%%"}
62
: ${graylog_run_dir:="/var/graylog"}
62
: ${graylog_data_dir:="%%GRAYLOG_DATA_DIR%%"}
63
: ${graylog_java_home:="%%JAVA_HOME%%"}
63
: ${graylog_run_dir:="/var/run/graylog"}
64
: ${graylog_log4j_config="file://%%ETCDIR%%/graylog_logging.xml"}
64
: ${graylog_log_file:="/var/log/graylog-server.log"}
65
65
66
66
67
java_options=" -Xms${graylog_min_mem} \
67
java_options=" -Xms${graylog_min_mem} \
Lines 72-96 Link Here
72
               -XX:+CMSConcurrentMTEnabled \
72
               -XX:+CMSConcurrentMTEnabled \
73
               -XX:+CMSClassUnloadingEnabled \
73
               -XX:+CMSClassUnloadingEnabled \
74
               -XX:+UseParNewGC \
74
               -XX:+UseParNewGC \
75
               -XX:-OmitStackTraceInFastThrow\
75
               -XX:-OmitStackTraceInFastThrow"
76
               -Djava.library.path=${graylog_dir}/lib/sigar \
77
               -Dlog4j.configuration=${graylog_log4j_config}"
78
76
79
start_precmd="graylog_precmd"
77
start_precmd="graylog_precmd"
80
78
81
pidfile=/var/run/${name}.pid
79
pidfile="${graylog_run_dir}/${name}.pid"
82
command=/usr/sbin/daemon
80
command=/usr/bin/nohup
83
procname=`env JAVAVM_DRYRUN=true JAVA_VERSION=1.7+ %%LOCALBASE%%/bin/java | grep JAVAVM_PROG | cut -f 2 -d =`
84
81
85
command_args="-p $pidfile -f /usr/local/bin/java ${java_options} -jar ${graylog_dir}/graylog.jar server --configfile ${graylog_config} --no-pid-file"
82
command_args="java -jar /usr/local/graylog/graylog.jar server \
83
              --configfile \"${graylog_config}\" \
84
              --pidfile \"${pidfile}\" \
85
              >> \"${graylog_log_file}\" \
86
              2>> \"${graylog_log_file}\" &"
86
87
87
graylog_precmd() {
88
graylog_precmd() {
88
    /usr/bin/install -d -o ${graylog_group} -g ${graylog_group} -m 755 /var/log/graylog
89
    if [ ! -f "${graylog_config}" ]; then
89
    /usr/bin/install -d -o ${graylog_group} -g ${graylog_group} -m 755 /var/log/graylog/server
90
        echo "Configuration file ${graylog_config} not found"
90
    /usr/bin/install -d -o ${graylog_group} -g ${graylog_group} -m 755 ${graylog_run_dir}
91
        exit 1
91
    touch $pidfile
92
    fi
92
    chown ${graylog_user}:${graylog_group} ${pidfile}
93
93
    cd ${graylog_run_dir}
94
    if [ ! -f "${graylog_log_file}" ]; then
95
        touch "${graylog_log_file}"
96
        chown "${graylog_user}:${graylog_group}" "${graylog_log_file}"
97
        chmod 640 "${graylog_log_file}"
98
    fi
99
100
    install -d -o ${graylog_user} -g ${graylog_group} -m 750 "${graylog_data_dir}"
101
    install -d -o ${graylog_user} -g ${graylog_group} -m 750 "${graylog_run_dir}"
94
}
102
}
95
103
96
run_rc_command "$1"
104
run_rc_command "$1"
(-)files/graylog_logging.xml (-34 lines)
Lines 1-34 Link Here
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
3
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
4
5
    <appender name="FILE" class="org.apache.log4j.rolling.RollingFileAppender">
6
        <rollingPolicy class="org.apache.log4j.rolling.FixedWindowRollingPolicy" >
7
            <param name="activeFileName" value="/var/log/graylog/server.log" /> <!-- ADAPT -->
8
            <param name="fileNamePattern" value="/var/log/graylog/server.%i.log" /> <!-- ADAPT -->
9
            <param name="minIndex" value="1" /> <!-- ADAPT -->
10
            <param name="maxIndex" value="10" /> <!-- ADAPT -->
11
        </rollingPolicy>
12
        <triggeringPolicy class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
13
            <param name="maxFileSize" value="5767168" /> <!-- ADAPT: For example 5.5MB in bytes -->
14
        </triggeringPolicy>
15
        <layout class="org.apache.log4j.PatternLayout">
16
            <param name="ConversionPattern" value="%d %-5p: %c - %m%n"/>
17
        </layout>
18
    </appender>
19
20
    <!-- Application Loggers -->
21
    <logger name="org.graylog2">
22
        <level value="info"/>
23
    </logger>
24
    <!-- this emits a harmless warning for ActiveDirectory every time which we can't work around :( -->
25
    <logger name="org.apache.directory.api.ldap.model.message.BindRequestImpl">
26
        <level value="error"/>
27
    </logger>
28
    <!-- Root Logger -->
29
    <root>
30
        <priority value="info"/>
31
        <appender-ref ref="FILE"/>
32
    </root>
33
34
</log4j:configuration>
(-)files/pkg-message.in (+9 lines)
Line 0 Link Here
1
======================================================================
2
3
Please see %%ETCDIR%% for sample versions of
4
server.conf
5
6
For GeoIP support you need to install the net/GeoIP port and
7
configure the path to the GeoIP databases in the Graylog Web Interface
8
9
======================================================================
(-)files/server.conf.sample.in (+376 lines)
Line 0 Link Here
1
# If you are running more than one instances of graylog2-server you have to select one of these
2
# instances as master. The master will perform some periodical tasks that non-masters won't perform.
3
is_master = true
4
5
# The auto-generated node ID will be stored in this file and read after restarts. It is a good idea
6
# to use an absolute file path here if you are starting graylog2-server from init scripts or similar.
7
node_id_file = /var/graylog/server/node-id
8
9
# You MUST set a secret to secure/pepper the stored user passwords here. Use at least 64 characters.
10
# Generate one by using for example: pwgen -N 1 -s 96
11
password_secret =
12
13
# The default root user is named 'admin'
14
#root_username = admin
15
16
# You MUST specify a hash password for the root user (which you only need to initially set up the
17
# system and in case you lose connectivity to your authentication backend)
18
# This password cannot be changed using the API or via the web interface. If you need to change it,
19
# modify it in this file.
20
# Create one by using for example: echo -n yourpassword | shasum -a 256
21
# and put the resulting hash value into the following line
22
root_password_sha2 =
23
24
# The email address of the root user.
25
# Default is empty
26
#root_email = ""
27
28
# The time zone setting of the root user.
29
# Default is UTC
30
#root_timezone = UTC
31
32
# Set plugin directory here (relative or absolute)
33
plugin_dir = %%GRAYLOG_DIR%%/plugin
34
35
# REST API listen URI. Must be reachable by other graylog2-server nodes if you run a cluster.
36
rest_listen_uri = http://127.0.0.1:12900/
37
38
# REST API transport address. Defaults to the value of rest_listen_uri. Exception: If rest_listen_uri
39
# is set to a wildcard IP address (0.0.0.0) the first non-loopback IPv4 system address is used.
40
# If set, his will be promoted in the cluster discovery APIs, so other nodes may try to connect on
41
# this address and it is used to generate URLs addressing entities in the REST API. (see rest_listen_uri)
42
# You will need to define this, if your Graylog server is running behind a HTTP proxy that is rewriting
43
# the scheme, host name or URI.
44
#rest_transport_uri = http://192.168.1.1:12900/
45
46
# Enable CORS headers for REST API. This is necessary for JS-clients accessing the server directly.
47
# If these are disabled, modern browsers will not be able to retrieve resources from the server.
48
# This is disabled by default. Uncomment the next line to enable it.
49
#rest_enable_cors = true
50
51
# Enable GZIP support for REST API. This compresses API responses and therefore helps to reduce
52
# overall round trip times. This is disabled by default. Uncomment the next line to enable it.
53
#rest_enable_gzip = true
54
55
# Enable HTTPS support for the REST API. This secures the communication with the REST API with
56
# TLS to prevent request forgery and eavesdropping. This is disabled by default. Uncomment the
57
# next line to enable it.
58
#rest_enable_tls = true
59
60
# The X.509 certificate file to use for securing the REST API.
61
#rest_tls_cert_file = /path/to/graylog2.crt
62
63
# The private key to use for securing the REST API.
64
#rest_tls_key_file = /path/to/graylog2.key
65
66
# The password to unlock the private key used for securing the REST API.
67
#rest_tls_key_password = secret
68
69
# The maximum size of a single HTTP chunk in bytes.
70
#rest_max_chunk_size = 8192
71
72
# The maximum size of the HTTP request headers in bytes.
73
#rest_max_header_size = 8192
74
75
# The maximal length of the initial HTTP/1.1 line in bytes.
76
#rest_max_initial_line_length = 4096
77
78
# The size of the execution handler thread pool used exclusively for serving the REST API.
79
#rest_thread_pool_size = 16
80
81
# The size of the worker thread pool used exclusively for serving the REST API.
82
#rest_worker_threads_max_pool_size = 16
83
84
# Embedded Elasticsearch configuration file
85
# pay attention to the working directory of the server, maybe use an absolute path here
86
#elasticsearch_config_file = /usr/local/etc/graylog/server/elasticsearch.yml
87
88
# Graylog will use multiple indices to store documents in. You can configured the strategy it uses to determine
89
# when to rotate the currently active write index.
90
# It supports multiple rotation strategies:
91
#   - "count" of messages per index, use elasticsearch_max_docs_per_index below to configure
92
#   - "size" per index, use elasticsearch_max_size_per_index below to configure
93
# valid values are "count", "size" and "time", default is "count"
94
rotation_strategy = count
95
96
# (Approximate) maximum number of documents in an Elasticsearch index before a new index
97
# is being created, also see no_retention and elasticsearch_max_number_of_indices.
98
# Configure this if you used 'rotation_strategy = count' above.
99
elasticsearch_max_docs_per_index = 20000000
100
101
# (Approximate) maximum size in bytes per Elasticsearch index on disk before a new index is being created, also see
102
# no_retention and elasticsearch_max_number_of_indices. Default is 1GB.
103
# Configure this if you used 'rotation_strategy = size' above.
104
#elasticsearch_max_size_per_index = 1073741824
105
106
# (Approximate) maximum time before a new Elasticsearch index is being created, also see
107
# no_retention and elasticsearch_max_number_of_indices. Default is 1 day.
108
# Configure this if you used 'rotation_strategy = time' above.
109
# Please note that this rotation period does not look at the time specified in the received messages, but is
110
# using the real clock value to decide when to rotate the index!
111
# Specify the time using a duration and a suffix indicating which unit you want:
112
#  1w  = 1 week
113
#  1d  = 1 day
114
#  12h = 12 hours
115
# Permitted suffixes are: d for day, h for hour, m for minute, s for second.
116
#elasticsearch_max_time_per_index = 1d
117
118
# Disable checking the version of Elasticsearch for being compatible with this Graylog release.
119
# WARNING: Using Graylog with unsupported and untested versions of Elasticsearch may lead to data loss!
120
#elasticsearch_disable_version_check = true
121
122
# Disable message retention on this node, i. e. disable Elasticsearch index rotation.
123
#no_retention = false
124
125
# How many indices do you want to keep?
126
elasticsearch_max_number_of_indices = 20
127
128
# Decide what happens with the oldest indices when the maximum number of indices is reached.
129
# The following strategies are availble:
130
#   - delete # Deletes the index completely (Default)
131
#   - close # Closes the index and hides it from the system. Can be re-opened later.
132
retention_strategy = delete
133
134
# How many Elasticsearch shards and replicas should be used per index? Note that this only applies to newly created indices.
135
elasticsearch_shards = 4
136
elasticsearch_replicas = 0
137
138
# Prefix for all Elasticsearch indices and index aliases managed by Graylog.
139
elasticsearch_index_prefix = graylog2
140
141
# Do you want to allow searches with leading wildcards? This can be extremely resource hungry and should only
142
# be enabled with care. See also: https://www.graylog.org/documentation/general/queries/
143
allow_leading_wildcard_searches = false
144
145
# Do you want to allow searches to be highlighted? Depending on the size of your messages this can be memory hungry and
146
# should only be enabled after making sure your Elasticsearch cluster has enough memory.
147
allow_highlighting = false
148
149
# settings to be passed to elasticsearch's client (overriding those in the provided elasticsearch_config_file)
150
# all these
151
# this must be the same as for your Elasticsearch cluster
152
#elasticsearch_cluster_name = graylog2
153
154
# you could also leave this out, but makes it easier to identify the graylog2 client instance
155
#elasticsearch_node_name = graylog2-server
156
157
# we don't want the graylog2 server to store any data, or be master node
158
#elasticsearch_node_master = false
159
#elasticsearch_node_data = false
160
161
# use a different port if you run multiple Elasticsearch nodes on one machine
162
#elasticsearch_transport_tcp_port = 9350
163
164
# we don't need to run the embedded HTTP server here
165
#elasticsearch_http_enabled = false
166
167
#elasticsearch_discovery_zen_ping_multicast_enabled = false
168
#elasticsearch_discovery_zen_ping_unicast_hosts = 192.168.1.203:9300
169
170
# Change the following setting if you are running into problems with timeouts during Elasticsearch cluster discovery.
171
# The setting is specified in milliseconds, the default is 5000ms (5 seconds).
172
#elasticsearch_cluster_discovery_timeout = 5000
173
174
# the following settings allow to change the bind addresses for the Elasticsearch client in graylog2
175
# these settings are empty by default, letting Elasticsearch choose automatically,
176
# override them here or in the 'elasticsearch_config_file' if you need to bind to a special address
177
# refer to http://www.elasticsearch.org/guide/en/elasticsearch/reference/0.90/modules-network.html
178
# for special values here
179
#elasticsearch_network_host =
180
#elasticsearch_network_bind_host =
181
#elasticsearch_network_publish_host =
182
183
# The total amount of time discovery will look for other Elasticsearch nodes in the cluster
184
# before giving up and declaring the current node master.
185
#elasticsearch_discovery_initial_state_timeout = 3s
186
187
# Analyzer (tokenizer) to use for message and full_message field. The "standard" filter usually is a good idea.
188
# All supported analyzers are: standard, simple, whitespace, stop, keyword, pattern, language, snowball, custom
189
# Elasticsearch documentation: http://www.elasticsearch.org/guide/reference/index-modules/analysis/
190
# Note that this setting only takes effect on newly created indices.
191
elasticsearch_analyzer = standard
192
193
# Batch size for the Elasticsearch output. This is the maximum (!) number of messages the Elasticsearch output
194
# module will get at once and write to Elasticsearch in a batch call. If the configured batch size has not been
195
# reached within output_flush_interval seconds, everything that is available will be flushed at once. Remember
196
# that every outputbuffer processor manages its own batch and performs its own batch write calls.
197
# ("outputbuffer_processors" variable)
198
output_batch_size = 500
199
200
# Flush interval (in seconds) for the Elasticsearch output. This is the maximum amount of time between two
201
# batches of messages written to Elasticsearch. It is only effective at all if your minimum number of messages
202
# for this time period is less than output_batch_size * outputbuffer_processors.
203
output_flush_interval = 1
204
205
# As stream outputs are loaded only on demand, an output which is failing to initialize will be tried over and
206
# over again. To prevent this, the following configuration options define after how many faults an output will
207
# not be tried again for an also configurable amount of seconds.
208
output_fault_count_threshold = 5
209
output_fault_penalty_seconds = 30
210
211
# The number of parallel running processors.
212
# Raise this number if your buffers are filling up.
213
processbuffer_processors = 5
214
outputbuffer_processors = 3
215
216
#outputbuffer_processor_keep_alive_time = 5000
217
#outputbuffer_processor_threads_core_pool_size = 3
218
#outputbuffer_processor_threads_max_pool_size = 30
219
220
# UDP receive buffer size for all message inputs (e. g. SyslogUDPInput).
221
#udp_recvbuffer_sizes = 1048576
222
223
# Wait strategy describing how buffer processors wait on a cursor sequence. (default: sleeping)
224
# Possible types:
225
#  - yielding
226
#     Compromise between performance and CPU usage.
227
#  - sleeping
228
#     Compromise between performance and CPU usage. Latency spikes can occur after quiet periods.
229
#  - blocking
230
#     High throughput, low latency, higher CPU usage.
231
#  - busy_spinning
232
#     Avoids syscalls which could introduce latency jitter. Best when threads can be bound to specific CPU cores.
233
processor_wait_strategy = blocking
234
235
# Size of internal ring buffers. Raise this if raising outputbuffer_processors does not help anymore.
236
# For optimum performance your LogMessage objects in the ring buffer should fit in your CPU L3 cache.
237
# Start server with --statistics flag to see buffer utilization.
238
# Must be a power of 2. (512, 1024, 2048, ...)
239
ring_size = 65536
240
241
inputbuffer_ring_size = 65536
242
inputbuffer_processors = 2
243
inputbuffer_wait_strategy = blocking
244
245
# Enable the disk based message journal.
246
message_journal_enabled = true
247
248
# The directory which will be used to store the message journal. The directory must me exclusively used by Graylog and
249
# must not contain any other files than the ones created by Graylog itself.
250
message_journal_dir = %%GRAYLOG_DATA_DIR%%/journal
251
252
# Journal hold messages before they could be written to Elasticsearch.
253
# For a maximum of 12 hours or 5 GB whichever happens first.
254
# During normal operation the journal will be smaller.
255
#message_journal_max_age = 12h
256
#message_journal_max_size = 5gb
257
258
#message_journal_flush_age = 1m
259
#message_journal_flush_interval = 1000000
260
#message_journal_segment_age = 1h
261
#message_journal_segment_size = 100mb
262
263
# Number of threads used exclusively for dispatching internal events. Default is 2.
264
#async_eventbus_processors = 2
265
266
# EXPERIMENTAL: Dead Letters
267
# Every failed indexing attempt is logged by default and made visible in the web-interface. You can enable
268
# the experimental dead letters feature to write every message that was not successfully indexed into the
269
# MongoDB "dead_letters" collection to make sure that you never lose a message. The actual writing of dead
270
# letter should work fine already but it is not heavily tested yet and will get more features in future
271
# releases.
272
dead_letters_enabled = false
273
274
# How many seconds to wait between marking node as DEAD for possible load balancers and starting the actual
275
# shutdown process. Set to 0 if you have no status checking load balancers in front.
276
lb_recognition_period_seconds = 3
277
278
# Every message is matched against the configured streams and it can happen that a stream contains rules which
279
# take an unusual amount of time to run, for example if its using regular expressions that perform excessive backtracking.
280
# This will impact the processing of the entire server. To keep such misbehaving stream rules from impacting other
281
# streams, Graylog limits the execution time for each stream.
282
# The default values are noted below, the timeout is in milliseconds.
283
# If the stream matching for one stream took longer than the timeout value, and this happened more than "max_faults" times
284
# that stream is disabled and a notification is shown in the web interface.
285
#stream_processing_timeout = 2000
286
#stream_processing_max_faults = 3
287
288
# Length of the interval in seconds in which the alert conditions for all streams should be checked
289
# and alarms are being sent.
290
#alert_check_interval = 60
291
292
# Since 0.21 the graylog2 server supports pluggable output modules. This means a single message can be written to multiple
293
# outputs. The next setting defines the timeout for a single output module, including the default output module where all
294
# messages end up.
295
#
296
# Time in milliseconds to wait for all message outputs to finish writing a single message.
297
#output_module_timeout = 10000
298
299
# Time in milliseconds after which a detected stale master node is being rechecked on startup.
300
#stale_master_timeout = 2000
301
302
# Time in milliseconds which Graylog is waiting for all threads to stop on shutdown.
303
#shutdown_timeout = 30000
304
305
# MongoDB Configuration
306
mongodb_useauth = false
307
#mongodb_user = grayloguser
308
#mongodb_password = 123
309
mongodb_host = 127.0.0.1
310
#mongodb_replica_set = localhost:27017,localhost:27018,localhost:27019
311
mongodb_database = graylog2
312
mongodb_port = 27017
313
314
# Raise this according to the maximum connections your MongoDB server can handle if you encounter MongoDB connection problems.
315
mongodb_max_connections = 100
316
317
# Number of threads allowed to be blocked by MongoDB connections multiplier. Default: 5
318
# If mongodb_max_connections is 100, and mongodb_threads_allowed_to_block_multiplier is 5, then 500 threads can block. More than that and an exception will be thrown.
319
# http://api.mongodb.org/java/current/com/mongodb/MongoOptions.html#threadsAllowedToBlockForConnectionMultiplier
320
mongodb_threads_allowed_to_block_multiplier = 5
321
322
# Drools Rule File (Use to rewrite incoming log messages)
323
# See: https://www.graylog.org/documentation/general/rewriting/
324
#rules_file = /usr/local/etc/graylog/server/rules.drl
325
326
# Email transport
327
#transport_email_enabled = false
328
#transport_email_hostname = mail.example.com
329
#transport_email_port = 587
330
#transport_email_use_auth = true
331
#transport_email_use_tls = true
332
#transport_email_use_ssl = true
333
#transport_email_auth_username = you@example.com
334
#transport_email_auth_password = secret
335
#transport_email_subject_prefix = [graylog2]
336
#transport_email_from_email = graylog2@example.com
337
338
# Specify and uncomment this if you want to include links to the stream in your stream alert mails.
339
# This should define the fully qualified base url to your web interface exactly the same way as it is accessed by your users.
340
#transport_email_web_interface_url = https://graylog2.example.com
341
342
# HTTP proxy for outgoing HTTP calls
343
#http_proxy_uri =
344
345
# Disable the optimization of Elasticsearch indices after index cycling. This may take some load from Elasticsearch
346
# on heavily used systems with large indices, but it will decrease search performance. The default is to optimize
347
# cycled indices.
348
#disable_index_optimization = true
349
350
# Optimize the index down to <= index_optimization_max_num_segments. A higher number may take some load from Elasticsearch
351
# on heavily used systems with large indices, but it will decrease search performance. The default is 1.
352
#index_optimization_max_num_segments = 1
353
354
# Disable the index range calculation on all open/available indices and only calculate the range for the latest
355
# index. This may speed up index cycling on systems with large indices but it might lead to wrong search results
356
# in regard to the time range of the messages (i. e. messages within a certain range may not be found). The default
357
# is to calculate the time range on all open/available indices.
358
#disable_index_range_calculation = true
359
360
# The threshold of the garbage collection runs. If GC runs take longer than this threshold, a system notification
361
# will be generated to warn the administrator about possible problems with the system. Default is 1 second.
362
#gc_warning_threshold = 1s
363
364
# Connection timeout for a configured LDAP server (e. g. ActiveDirectory) in milliseconds.
365
#ldap_connection_timeout = 2000
366
367
# https://github.com/bazhenov/groovy-shell-server
368
#groovy_shell_enable = false
369
#groovy_shell_port = 6789
370
371
# Enable collection of Graylog-related metrics into MongoDB
372
#enable_metrics_collection = false
373
374
# Disable the use of SIGAR for collecting system stats
375
disable_sigar = true
376
(-)pkg-plist (-2 / +9 lines)
Lines 1-3 Link Here
1
%%ETCDIR%%/graylog.conf.example
1
@sample(%%GRAYLOGUSER%%,%%GRAYLOGGROUP%%,440) %%ETCDIR%%/server/server.conf.sample
2
%%ETCDIR%%/graylog_logging.xml
2
@unexec if [ -d %%GRAYLOG_DATADIR%% ]; then echo "You should remove %%GRAYLOG_DATADIR%% if you don't need it any more."; fi
3
etc/rc.d/graylog
3
graylog/graylog.jar
4
graylog/graylog.jar
5
graylog/plugin/graylog-plugin-beats-1.1.3.jar
6
graylog/plugin/graylog-plugin-collector-1.1.2.jar
7
graylog/plugin/graylog-plugin-enterprise-integration-1.1.2.jar
8
graylog/plugin/graylog-plugin-map-widget-1.1.2.jar
9
graylog/plugin/graylog-plugin-pipeline-processor-1.1.2.jar
10
graylog/plugin/usage-statistics-2.1.2.jar

Return to bug 216593