Code Monkey home page Code Monkey logo

Comments (14)

hrez avatar hrez commented on June 11, 2024

I was just about to open the same issue.
Please add an attribute for unmanaged splunk server.

from chef-splunk.

jtimberman avatar jtimberman commented on June 11, 2024

I think this would be best implemented using a method that defines an interface to the required "splunk server" data, ipaddress:port, per the current implementation in outputs.conf's "server" directive.

At a highlevel, I think we'd have a method, #splunk_server_lookup in the cookbook's libraries.

params

lookup_type: the value is a String, an Array, or a Chef::Node::Attribute.

If it is a String, assume this is a search query to perform.

If it is an Array, assume this is a data bag name, and a data bag item to load, which adheres to a specific JSON structure.

If it is a Chef::Node::Attribute, assume it contains a value of another Chef attribute on the node to look up to use as the value.

We would set an attribute, node['splunk']['server_lookup'] that contains the parameter to send to this method, defaulting to the current search query to maintain compatibility.

node.default['splunk']['server_lookup'] = "splunk_is_server:true AND chef_environment:#{node.chef_environment}"

To specify a data bag and item, set the attribute in your favorite place (like a role, or a "wrapper" cookbook)

node.default['splunk']['server_lookup'] = ['splunk', 'servers']

Or, to set another attribute to look up:

node.default['splunk']['server_lookup'] = Chef::Node::ImmutableMash.new({'attrib' => 'my_splunk'})

This would likely have to be set in a cookbook, since making this supported in roles/environments that are JSON would be really awkward.

returns

A sorted Array of "ipaddress:port" strings. For example:

=> ["10.11.12.100:9997"]
=> ["10.11.12.100:9997", "192.168.77.88:8000"]

The results should be sorted, uniq, compacted, and flattened.

from chef-splunk.

jtimberman avatar jtimberman commented on June 11, 2024

@ampledata Thoughts?

from chef-splunk.

ampledata avatar ampledata commented on June 11, 2024

I like it, it works, and maintains compat and adds some awesome new abilities. You've got your work cut out for you! 👍

from chef-splunk.

jtimberman avatar jtimberman commented on June 11, 2024

Fwiw, I don't have cycles to add this functionality any time soon.

from chef-splunk.

trumant avatar trumant commented on June 11, 2024

I'll be happy to take a swing at this.

from chef-splunk.

trumant avatar trumant commented on June 11, 2024

@ampledata , @jtimberman and @hrez - Would appreciate your feedback on initial work: trumant@251072c

Still working on getting test kitchen tests rounded out to prove that data bag and node attribute configuration works.

from chef-splunk.

thomasbiddle avatar thomasbiddle commented on June 11, 2024

@jtimberman @trumant Any update on implementing this? +1 on it being hugely beneficial.

from chef-splunk.

trumant avatar trumant commented on June 11, 2024

@thomasbiddle - I didn't end up taking it any further because I ended up replacing my usage of this cookbook with an Ansible role as part of a broader move to Ansible.

from chef-splunk.

Sauraus avatar Sauraus commented on June 11, 2024

There is a simple way of doing this, add an attribute and if the server search returns nil, set the servers based on the values in the attribute.

from chef-splunk.

akemner avatar akemner commented on June 11, 2024

+1. this would be beneficial for people using 'Splunk Cloud'

from chef-splunk.

sworisbreathing avatar sworisbreathing commented on June 11, 2024

This could also be done by defining the outputs.conf in an app bundle and then using the splunk_app resource.

from chef-splunk.

tas50 avatar tas50 commented on June 11, 2024

#54 has a solution to this, but we need additional testing before it can be merged.

from chef-splunk.

rarsan avatar rarsan commented on June 11, 2024

Fixed with #93 . Closing.

from chef-splunk.

Related Issues (20)

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.