Advertisement
Guest User

Filebeat.yml

a guest
Jun 23rd, 2016
255
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 17.20 KB | None | 0 0
  1. ################### Filebeat Configuration Example #########################
  2.  
  3. ############################# Filebeat ######################################
  4. filebeat:
  5.  # List of prospectors to fetch data.
  6.   prospectors:
  7.    # Each - is a prospector. Below are the prospector specific configurations
  8.     -
  9.       # Paths that should be crawled and fetched. Glob based paths.
  10.       # To fetch all ".log" files from a specific level of subdirectories
  11.       # /var/log/*/*.log can be used.
  12.       # For each file found under this path, a harvester is started.
  13.       # Make sure not file is defined twice as this can lead to unexpected behaviour.
  14.       paths:
  15.        - /var/log/nginx/*access.log
  16.         #- c:\programdata\elasticsearch\logs\*
  17.  
  18.       # Configure the file encoding for reading files with international characters
  19.       # following the W3C recommendation for HTML5 (http://www.w3.org/TR/encoding).
  20.       # Some sample encodings:
  21.       #   plain, utf-8, utf-16be-bom, utf-16be, utf-16le, big5, gb18030, gbk,
  22.       #    hz-gb-2312, euc-kr, euc-jp, iso-2022-jp, shift-jis, ...
  23.       #encoding: plain
  24.  
  25.       # Type of the files. Based on this the way the file is read is decided.
  26.       # The different types cannot be mixed in one prospector
  27.       #
  28.       # Possible options are:
  29.       # * log: Reads every line of the log file (default)
  30.       # * stdin: Reads the standard in
  31.       input_type: log
  32.  
  33.       # Exclude lines. A list of regular expressions to match. It drops the lines that are
  34.       # matching any regular expression from the list. The include_lines is called before
  35.       # exclude_lines. By default, no lines are dropped.
  36.       # exclude_lines: ["^DBG"]
  37.  
  38.       # Include lines. A list of regular expressions to match. It exports the lines that are
  39.       # matching any regular expression from the list. The include_lines is called before
  40.       # exclude_lines. By default, all the lines are exported.
  41.       # include_lines: ["^ERR", "^WARN"]
  42.  
  43.       # Exclude files. A list of regular expressions to match. Filebeat drops the files that
  44.       # are matching any regular expression from the list. By default, no files are dropped.
  45.       # exclude_files: [".gz$"]
  46.  
  47.       # Optional additional fields. These field can be freely picked
  48.       # to add additional information to the crawled log files for filtering
  49.       #fields:
  50.       #  level: debug
  51.       #  review: 1
  52.  
  53.       # Set to true to store the additional fields as top level fields instead
  54.       # of under the "fields" sub-dictionary. In case of name conflicts with the
  55.       # fields added by Filebeat itself, the custom fields overwrite the default
  56.       # fields.
  57.       #fields_under_root: false
  58.  
  59.       # Ignore files which were modified more then the defined timespan in the past.
  60.       # In case all files on your system must be read you can set this value very large.
  61.       # Time strings like 2h (2 hours), 5m (5 minutes) can be used.
  62.       #ignore_older: 0
  63.  
  64.       # Close older closes the file handler for which were not modified
  65.       # for longer then close_older
  66.       # Time strings like 2h (2 hours), 5m (5 minutes) can be used.
  67.       #close_older: 1h
  68.  
  69.       # Type to be published in the 'type' field. For Elasticsearch output,
  70.       # the type defines the document type these entries should be stored
  71.       # in. Default: log
  72.       document_type: nginx-access
  73.  
  74.       # Scan frequency in seconds.
  75.       # How often these files should be checked for changes. In case it is set
  76.       # to 0s, it is done as often as possible. Default: 10s
  77.       #scan_frequency: 10s
  78.  
  79.       # Defines the buffer size every harvester uses when fetching the file
  80.       #harvester_buffer_size: 16384
  81.  
  82.       # Maximum number of bytes a single log event can have
  83.       # All bytes after max_bytes are discarded and not sent. The default is 10MB.
  84.       # This is especially useful for multiline log messages which can get large.
  85.       #max_bytes: 10485760
  86.  
  87.       # Mutiline can be used for log messages spanning multiple lines. This is common
  88.       # for Java Stack Traces or C-Line Continuation
  89.       #multiline:
  90.  
  91.         # The regexp Pattern that has to be matched. The example pattern matches all lines starting with [
  92.         #pattern: ^\[
  93.  
  94.         # Defines if the pattern set under pattern should be negated or not. Default is false.
  95.         #negate: false
  96.  
  97.         # Match can be set to "after" or "before". It is used to define if lines should be append to a pattern
  98.         # that was (not) matched before or after or as long as a pattern is not matched based on negate.
  99.         # Note: After is the equivalent to previous and before is the equivalent to to next in Logstash
  100.         #match: after
  101.  
  102.         # The maximum number of lines that are combined to one event.
  103.         # In case there are more the max_lines the additional lines are discarded.
  104.         # Default is 500
  105.         #max_lines: 500
  106.  
  107.         # After the defined timeout, an multiline event is sent even if no new pattern was found to start a new event
  108.         # Default is 5s.
  109.         #timeout: 5s
  110.  
  111.       # Setting tail_files to true means filebeat starts readding new files at the end
  112.       # instead of the beginning. If this is used in combination with log rotation
  113.       # this can mean that the first entries of a new file are skipped.
  114.       #tail_files: false
  115.  
  116.       # Backoff values define how agressively filebeat crawls new files for updates
  117.       # The default values can be used in most cases. Backoff defines how long it is waited
  118.       # to check a file again after EOF is reached. Default is 1s which means the file
  119.       # is checked every second if new lines were added. This leads to a near real time crawling.
  120.       # Every time a new line appears, backoff is reset to the initial value.
  121.       #backoff: 1s
  122.  
  123.       # Max backoff defines what the maximum backoff time is. After having backed off multiple times
  124.       # from checking the files, the waiting time will never exceed max_backoff idenependent of the
  125.       # backoff factor. Having it set to 10s means in the worst case a new line can be added to a log
  126.       # file after having backed off multiple times, it takes a maximum of 10s to read the new line
  127.       #max_backoff: 10s
  128.  
  129.       # The backoff factor defines how fast the algorithm backs off. The bigger the backoff factor,
  130.       # the faster the max_backoff value is reached. If this value is set to 1, no backoff will happen.
  131.       # The backoff value will be multiplied each time with the backoff_factor until max_backoff is reached
  132.       #backoff_factor: 2
  133.  
  134.       # This option closes a file, as soon as the file name changes.
  135.       # This config option is recommended on windows only. Filebeat keeps the files it's reading open. This can cause
  136.       # issues when the file is removed, as the file will not be fully removed until also Filebeat closes
  137.       # the reading. Filebeat closes the file handler after ignore_older. During this time no new file with the
  138.       # same name can be created. Turning this feature on the other hand can lead to loss of data
  139.       # on rotate files. It can happen that after file rotation the beginning of the new
  140.       # file is skipped, as the reading starts at the end. We recommend to leave this option on false
  141.       # but lower the ignore_older value to release files faster.
  142.       #force_close_files: false
  143.  
  144.     # Additional prospector
  145.     #-
  146.       # Configuration to use stdin input
  147.       #input_type: stdin
  148.  
  149.   # General filebeat configuration options
  150.   #
  151.   # Event count spool threshold - forces network flush if exceeded
  152.   #spool_size: 2048
  153.  
  154.   # Enable async publisher pipeline in filebeat (Experimental!)
  155.   #publish_async: false
  156.  
  157.   # Defines how often the spooler is flushed. After idle_timeout the spooler is
  158.   # Flush even though spool_size is not reached.
  159.   #idle_timeout: 5s
  160.  
  161.   # Name of the registry file. Per default it is put in the current working
  162.   # directory. In case the working directory is changed after when running
  163.   # filebeat again, indexing starts from the beginning again.
  164.   registry_file: /var/lib/filebeat/registry
  165.  
  166.   # Full Path to directory with additional prospector configuration files. Each file must end with .yml
  167.   # These config files must have the full filebeat config part inside, but only
  168.   # the prospector part is processed. All global options like spool_size are ignored.
  169.   # The config_dir MUST point to a different directory then where the main filebeat config file is in.
  170.   #config_dir:
  171.  
  172. ###############################################################################
  173. ############################# Libbeat Config ##################################
  174. # Base config file used by all other beats for using libbeat features
  175.  
  176. ############################# Output ##########################################
  177.  
  178. # Configure what outputs to use when sending the data collected by the beat.
  179. # Multiple outputs may be used.
  180. output:
  181.   ### Elasticsearch as output
  182.   elasticsearch:
  183.    # Array of hosts to connect to.
  184.     # Scheme and port can be left out and will be set to the default (http and 9200)
  185.     # In case you specify and additional path, the scheme is required: http://localhost:9200/path
  186.     # IPv6 addresses should always be defined as: https://[2001:db8::1]:9200
  187.     #hosts: ["e1b37c2c-70f8-4b5d-a45e-8e83fbfcf504-ls.logit.io:11739"]
  188.  
  189.     # Optional protocol and basic auth credentials.
  190.     #protocol: "https"
  191.     #username: "admin"
  192.     #password: "s3cr3t"
  193.  
  194.     # Number of workers per Elasticsearch host.
  195.     #worker: 1
  196.  
  197.     # Optional index name. The default is "filebeat" and generates
  198.     # [filebeat-]YYYY.MM.DD keys.
  199.     #index: "filebeat"
  200.  
  201.     # A template is used to set the mapping in Elasticsearch
  202.     # By default template loading is disabled and no template is loaded.
  203.     # These settings can be adjusted to load your own template or overwrite existing ones
  204.     #template:
  205.  
  206.       # Template name. By default the template name is filebeat.
  207.       #name: "filebeat"
  208.  
  209.       # Path to template file
  210.       #path: "filebeat.template.json"
  211.  
  212.       # Overwrite existing template
  213.       #overwrite: false
  214.  
  215.     # Optional HTTP Path
  216.     #path: "/elasticsearch"
  217.  
  218.     # Proxy server url
  219.     #proxy_url: http://proxy:3128
  220.  
  221.     # The number of times a particular Elasticsearch index operation is attempted. If
  222.     # the indexing operation doesn't succeed after this many retries, the events are
  223.     # dropped. The default is 3.
  224.     #max_retries: 3
  225.  
  226.     # The maximum number of events to bulk in a single Elasticsearch bulk API index request.
  227.     # The default is 50.
  228.     #bulk_max_size: 50
  229.  
  230.     # Configure http request timeout before failing an request to Elasticsearch.
  231.     #timeout: 90
  232.  
  233.     # The number of seconds to wait for new events between two bulk API index requests.
  234.     # If `bulk_max_size` is reached before this interval expires, addition bulk index
  235.     # requests are made.
  236.     #flush_interval: 1
  237.  
  238.     # Boolean that sets if the topology is kept in Elasticsearch. The default is
  239.     # false. This option makes sense only for Packetbeat.
  240.     #save_topology: false
  241.  
  242.     # The time to live in seconds for the topology information that is stored in
  243.     # Elasticsearch. The default is 15 seconds.
  244.     #topology_expire: 15
  245.  
  246.     # tls configuration. By default is off.
  247.     #tls:
  248.       # List of root certificates for HTTPS server verifications
  249.       #certificate_authorities: ["/etc/pki/root/ca.pem"]
  250.  
  251.       # Certificate for TLS client authentication
  252.       #certificate: "/etc/pki/client/cert.pem"
  253.  
  254.       # Client Certificate Key
  255.       #certificate_key: "/etc/pki/client/cert.key"
  256.  
  257.       # Controls whether the client verifies server certificates and host name.
  258.       # If insecure is set to true, all server host names and certificates will be
  259.       # accepted. In this mode TLS based connections are susceptible to
  260.       # man-in-the-middle attacks. Use only for testing.
  261.       #insecure: true
  262.  
  263.       # Configure cipher suites to be used for TLS connections
  264.       #cipher_suites: []
  265.  
  266.       # Configure curve types for ECDHE based cipher suites
  267.       #curve_types: []
  268.  
  269.       # Configure minimum TLS version allowed for connection to logstash
  270.       #min_version: 1.0
  271.  
  272.       # Configure maximum TLS version allowed for connection to logstash
  273.       #max_version: 1.2
  274.  
  275.  
  276.   ### Logstash as output
  277.   #logstash:
  278.     # The Logstash hosts
  279.     hosts: ["e1b37c2c-70f8-4b5d-a45e-8e83fbfcf504-ls.logit.io:11739"]
  280.  
  281.     # Number of workers per Logstash host.
  282.     #worker: 1
  283.  
  284.     # Set gzip compression level.
  285.     compression_level: 3
  286.  
  287.     # Optional load balance the events between the Logstash hosts
  288.     #loadbalance: true
  289.  
  290.     # Optional index name. The default index name depends on the each beat.
  291.     # For Packetbeat, the default is set to packetbeat, for Topbeat
  292.     # top topbeat and for Filebeat to filebeat.
  293.     #index: filebeat
  294.  
  295.     # Optional TLS. By default is off.
  296.     #tls:
  297.       # List of root certificates for HTTPS server verifications
  298.       #certificate_authorities: ["/etc/pki/root/ca.pem"]
  299.  
  300.       # Certificate for TLS client authentication
  301.       #certificate: "/etc/pki/client/cert.pem"
  302.  
  303.       # Client Certificate Key
  304.       #certificate_key: "/etc/pki/client/cert.key"
  305.  
  306.       # Controls whether the client verifies server certificates and host name.
  307.       # If insecure is set to true, all server host names and certificates will be
  308.       # accepted. In this mode TLS based connections are susceptible to
  309.       # man-in-the-middle attacks. Use only for testing.
  310.       #insecure: true
  311.  
  312.       # Configure cipher suites to be used for TLS connections
  313.       #cipher_suites: []
  314.  
  315.       # Configure curve types for ECDHE based cipher suites
  316.       #curve_types: []
  317.  
  318.  
  319.   ### File as output
  320.   file:
  321.    # Path to the directory where to save the generated files. The option is mandatory.
  322.     path: "/tmp/filebeat"
  323.  
  324.     # Name of the generated files. The default is `filebeat` and it generates files: `filebeat`, `filebeat.1`, `filebeat.2`, etc.
  325.     filename: filebeat
  326.  
  327.     # Maximum size in kilobytes of each file. When this size is reached, the files are
  328.     # rotated. The default value is 10 MB.
  329.     rotate_every_kb: 10000
  330.  
  331.     # Maximum number of files under path. When this number of files is reached, the
  332.     # oldest file is deleted and the rest are shifted from last to first. The default
  333.     # is 7 files.
  334.     number_of_files: 7
  335.  
  336.  
  337.   ### Console output
  338.   console:
  339.    # Pretty print json event
  340.     pretty: true
  341.  
  342.  
  343. ############################# Shipper #########################################
  344.  
  345. shipper:
  346.  # The name of the shipper that publishes the network data. It can be used to group
  347.   # all the transactions sent by a single shipper in the web interface.
  348.   # If this options is not defined, the hostname is used.
  349.   #name:
  350.  
  351.   # The tags of the shipper are included in their own field with each
  352.   # transaction published. Tags make it easy to group servers by different
  353.   # logical properties.
  354.   #tags: ["service-X", "web-tier"]
  355.  
  356.   # Uncomment the following if you want to ignore transactions created
  357.   # by the server on which the shipper is installed. This option is useful
  358.   # to remove duplicates if shippers are installed on multiple servers.
  359.   #ignore_outgoing: true
  360.  
  361.   # How often (in seconds) shippers are publishing their IPs to the topology map.
  362.   # The default is 10 seconds.
  363.   #refresh_topology_freq: 10
  364.  
  365.   # Expiration time (in seconds) of the IPs published by a shipper to the topology map.
  366.   # All the IPs will be deleted afterwards. Note, that the value must be higher than
  367.   # refresh_topology_freq. The default is 15 seconds.
  368.   #topology_expire: 15
  369.  
  370.   # Internal queue size for single events in processing pipeline
  371.   #queue_size: 1000
  372.  
  373.   # Configure local GeoIP database support.
  374.   # If no paths are not configured geoip is disabled.
  375.   #geoip:
  376.     #paths:
  377.     #  - "/usr/share/GeoIP/GeoLiteCity.dat"
  378.     #  - "/usr/local/var/GeoIP/GeoLiteCity.dat"
  379.  
  380.  
  381. ############################# Logging #########################################
  382.  
  383. # There are three options for the log ouput: syslog, file, stderr.
  384. # Under Windos systems, the log files are per default sent to the file output,
  385. # under all other system per default to syslog.
  386. logging:
  387.   # Send all logging output to syslog. On Windows default is false, otherwise
  388.   # default is true.
  389.   #to_syslog: true
  390.  
  391.   # Write all logging output to files. Beats automatically rotate files if rotateeverybytes
  392.   # limit is reached.
  393.   #to_files: false
  394.  
  395.   # To enable logging to files, to_files option has to be set to true
  396.   files:
  397.    # The directory where the log files will written to.
  398.     path: /var/log/mybeat
  399.  
  400.     # The name of the files where the logs are written to.
  401.     name: mybeat
  402.  
  403.     # Configure log file size limit. If limit is reached, log file will be
  404.     # automatically rotated
  405.     rotateeverybytes: 10485760 # = 10MB
  406.  
  407.     # Number of rotated log files to keep. Oldest files will be deleted first.
  408.     keepfiles: 7
  409.  
  410.   # Enable debug output for selected components. To enable all selectors use ["*"]
  411.   # Other available selectors are beat, publish, service
  412.   # Multiple selectors can be chained.
  413.   #selectors: [ ]
  414.  
  415.   # Sets log level. The default log level is error.
  416.   # Available log levels are: critical, error, warning, info, debug
  417.   #level: error
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement