Once in a while, when working with Jinja templating engine, you might need to create a random Bit Set with Jinja. Some might also call it a Binary Flag Set.
Basically, this will be a binary number (for example
10110) where each digit (bit) represents whether something is on/enabled/present or off.
In some systems, this binary number is actually stored as a base 10 integer. So
Continue reading Create a Random Bit Set with Jinja
10110 will be stored as
Once in a while, when working with Jinja templating engine, you might need to create a random GUID with Jinja.
Continue reading Create Random GUID with Jinja
I’ve recently dipped my toes into Splunk Eventgen (Jinja templating). It’s an awesome app that allows you to generate sample events that can be ingested by Splunk (or for any other reason).
EventGen has two ways of configuring the event content generation:
- Traditional – where you specify a sample file and provide regexes that will be used to replace static content in the sample file with the required values
- Jinja Templating – where you use Jinja templating engine to create the events.
While the traditional way is quite straightforward, the event’s format that I was after had a few nuances that made it not suitable for me, thus I had to fiddle with Splunk Eventgen Jinja templating.
Continue reading Splunk Eventgen Jinja templating
Here is how we have used goss and Ansible templates to run system tests after building syslog-ng servers
Continue reading Using goss and Ansible templates for System Testing
I’ve started using Ansible at my work, where we use it to deploy Splunk environments.
One of the things I needed to do is to provide a list of tcp ports to a “with_items” statement in a form of list.
Continue reading Ansible – loop over netsted variables