Giter Site home page Giter Site logo

splunkforwarder-formula's Introduction

splunkforwarder Salt Formula

Install the Splunk Universal Forwarder to forward your logs to Splunk.

See the full Salt Formulas installation and usage instructions

Available states

splunkforwarder

Install Splunk Universal Forwarder and all its dependencies, then start the service.

If you configured splunkforwarder:intermediate = True, this includes the splunkforwarder.intermediate-forwarder recipe.

splunkforwarder.certs

Install SSL certificates.

splunkforwarder.forwarder

Install Splunk Unversal Forwarder and start the service.

splunkforwarder.intermediate-forwarder

Configure Splunk Universal Forwarder to be an intermediate forwarder. E.g. it accepts forwarded logs from other servers and forwards them further upstream.

splunkforwarder.secret

Install shared Splunk secret.

Configuration

Splunk Forwarder Required Pillar Items

splunkforwarder:version

What version of Splunk Universal Forwarder are you installing?

Example:

splunkforwarder:
  version: 6.2.0

splunkforwarder:package_filename

The name of the package you are installing.

Example:

splunkforwarder:
  package_filename: splunkforwarder-6.2.0-237341-linux-2.6-amd64.deb

splunkforwarder:source_hash

The checksum of the file you're installing.

Example:

splunkforwarder:
  source_hash: sha256=xxxxxx

splunkforwarder:download_base_url

This URL must contain a trailing slash.

Splunk does not make their packages available for public download. You must login to your Splunk account, download the package you want, and put it on your own HTTP/FTP/S3/whatever server for your machines to access.

This is the base URL where you put the images.

Example:

splunkforwarder:
  download_base_url: http://your.domain.com/downloads/

splunkforwarder:forward_servers (List)

This is a list of servers to forward to. Splunk will treat these like a round-robin and will forward to all of the servers in the list. If/when one goes down the others will get the traffic.

Example:

splunkforwarder:
  forward_servers:
    - 1.2.3.4:9998
    - 1.2.4.5:9998

At least 1 server is required, presumably you can configure as many as you like.

splunkforwarder:inputs:monitor (Dict)

This is a dictionary containing all of the files you want to monitor. The name of the dictionary is not used other than to guarantee uniqueness of each entry (a Salt constraint).

There is 1 required entry in each, monitor which is used in Splunk's inputs.conf monitor stanza. Here again this should be unique and it can contain any characters that Splunk will accept as a monitoring stanza.

Any additional entries are added directly to the [monitor] stanza in Splunk.

Example:

splunkforwarder:
  inputs:
    monitor:
      nginx-error-log:
        monitor: /var/log/nginx/error.log
        index: search
        sourcetype: nginx_error_log

Resulting Splunk inputs.conf Stanza:

[monitor:///var/log/nginx/error.log]
index = search
sourcetype = nginx_error_log

Splunk Forwarder Optional Pillar Items

splunkforwarder:intermediate

Default = False

Set it to True if you want this machine to accept incoming connections from other Splunk forwarders to be forwarded on upstream.

Splunk Required Pillar Items

splunk:secret

This is a shared secret across all your splunk forwarders. It allows for the password encryption to yield the same result across your servers, so you can store your password encrypted in your pillar.

splunk:password:inputs.conf

Your Splunk password. If you know the encrypted version, use it.

If you don't know the encrypted version, put it in plain text. See the section figuring out your encrypted passwords below to see how to determine what your encrypted password is.

splunk:password:outputs.conf

Your Splunk password. If you know the encrypted version, use it.

If you don't know the encrypted version, put it in plain text. See the section figuring out your encrypted passwords below to see how to determine what your encrypted password is.

splunk:certs (Dict)

Each of the SSL certificates you need to install.

Example:

splunk:
  certs:
    cacert.pem:
      content: |
        -----BEGIN CERTIFICATE-----
        xxxxxxYourCertificateHerexxxxxx
        -----END CERTIFICATE-----
    selfsignedcert.pem:
      content: |
        -----BEGIN CERTIFICATE-----
        xxxxxxYourCertificateHerexxxxxx
        -----END CERTIFICATE-----

Note that you don't have to use a selfsignedcert.pem, you can use a real cert if you have one. In that case you must configure splunk:self_cert_filename to match the name of the cert you added here in lieu of selfsignedcert.pem.

Splunk Optional Pillar Items

splunk:self_cert_filename

Default = selfsignedcert.pem

Name of the SSL cert used by the current machine to talk to other machines. If you have real certs, replace this with the name of your cert.

NOTE: The cert named here MUST exist in splunk:certs:{{name}}:content so we can install that cert on the Splunk server. Either that, or you must manually install it into /opt/splunkforwarder/etc/certs/{{name}} before you try installing splunkforwarder.

Figuring out your encrypted passwords

The trickiest part of the configuration is dealing with the encrypted passwords. Splunk doesn't publicize its salt method so it's not possible to know what the encrypted passwords will be without letting Splunk do the encryption itself.

Thus it's a 3 step process:

  1. Enter plain text passwords in your pillars for splunk:password:inputs.conf and for splunk:password:outputs.conf

  2. salt-call state.sls splunkforwarder

  3. On the system you just installed Splunk onto, inspect these files:

  • /opt/splunkforwarder/etc/system/local/inputs.conf
    • copy the encrypted value of password into the splunk:password:inputs.conf pillar
  • /opt/splunkforwarder/etc/system/local/outputs.conf
    • copy the encrypted value of sslPassword into the splunk:password:outputs.conf pillar

Now you have the encrypted value stored in your pillar instead of the plain text. For this to work, the same splunk:secret must be shared across all machines using these encrypted passwords.

Note: The same exact password will have 2 different encrypted values, one for inputs.conf and one for outputs.conf. Presumably the name of the file that it gets written to is part of the encryption.

splunkforwarder-formula's People

Contributors

ch-acctg avatar devaos avatar gekitsuu avatar nmadhok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

splunkforwarder-formula's Issues

universal forwarder credentials

how can we install universal forwarder credentials with this formula? i'm using a splunk cloud instance and firstly i have to install credential file(splunkclouduf.spl) to add a file for monitoring.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.