Kintyre / ksconf

Kintyre's Splunk Configuration tool
Apache License 2.0
50 stars 13 forks source link

Implement merge magic #8

Open lowell80 opened 6 years ago

lowell80 commented 6 years ago

This is mostly a brain dump, probably need to split this into more specific tickets

Here are my thoughts on what this could look like:

It may be nice to set these up and register them via decorators. Make all filter calls align with Python function calling norms (like what Jinja2 does)

 @register_filter("APPEND")
 def filter_op_APPEND(context, sep=","):
     # context.op       name of the filter, "APPEND" in this case.
     # context.stanza   name of the current stanza
     # context.key      the key who's value is being operated upon
     # context.parent   original string value
     # context.payload  raw value of the current key, without magic text (may be blank)

Allow for standard python style function argument passing; allowing for both positional and named parameters (that is *arg and **kwargs)

crumpetcrusher commented 3 years ago

An additional feature would be tombstoning an entire .conf file (or dir!), something like this.

├─bin
├─conf.d
│ ├─10-upstream
│ │ ├─data
│ │ │ └─ui
│ │ │   └─views
│ │ │     └─dashboard.xml
│ │ ├─inputs.conf
│ │ └─indexes.conf
│ ├─40-idx_layer
│ │ ├─data.disabled # empty file, remove data dir entirely when included in combine/package/etc.
│ │ ├─inputs.conf.disabled # not needed at idx if using heavy forwarder
│ │ └─indexes.conf # maybe edits for retention or volumes
│ └─50-shc_layer
│   └─indexes.conf.disabled # empty file, remove it entirely.
├─lookups

I think this is what slim partition is intending to do, but I can't confirm it's doing anything in its current state. It's never generated proper layers for me. It seems to be intended as straight magic in that it just knows you wouldn't have views on an indexer so drop all those. 🤷‍♂️

lowell80 commented 3 years ago

@crumpetcrusher. That's a really good point. Yeah slim's @placement XXX idea is really interesting, but somewhat problematic imho.

I'm going to open this as a new enhancement ticket and put a proper reply in there.