How to automating the process of creating logstash configuration file - logstash

I want to ask that,
how to automating the process of creating logstash configuration file ? I mean that creating a script that generates configuration files. I mean, giving grok patterns from console etc, that auto generate the configuration files. Can someone give an example ?
Thanks for answering.

For this kind of function, you have 2 options :
Hard : ansible, looks this role to look how to use it to deploy logstash configuration file. This option is hard, because you need to learn the basic usage of ansible, but this is not a waste of time.
Easy : basic jinja template, this option is more easy because the jinja template is just a part of ansible, so it's more easy to use it and learn.

Related

How to integrate TestStand User Interface during deployment?

I made some test sequences and a workspace in TestStand. I want to deploy those sequences and make a MSI based executable. However, I am not sure how can I include the files for Simple or Full Featured UI into the workspace and include it during deployment or call the UI content folder directly during the deployment.
Can anyone please help me?
Just insert folder with custom user interface into workspace https://www.ni.com/docs/en-US/bundle/teststand/page/tsref/infotopics/db_add_file_to_wksp.htm.
Then you will see inserted files in Deployment Utility.
But better practice would be to separate installers of user interface, and sequence itself. Because mostly you will do more changes/updates/fixes to sequence files, so you will need to redeploy just them.
This is a big undertaking, but may be worth it for you depending on the size of your company. TestStand has an API that you can use to develop a custom GUI. That GUI can then open any sequence file you like after being compiled as a C program that runs as an executable file.

How to load a new configuration file?

I'm wondering how to load a new configuration file for a service with and without changing its process ID with writing commands?
I couldn't find a simple answer
Here is a simple way to realise it.
Firstly, you need a .ini file, which is your configuration file.
Secondly, edit your code and adding a new class or structure to save the settings, every time it start, the configuration file will be loaded and using the settings to run.
Then, your code need one more thing : a command to reload configuration file, which will change the state of the settings class/structure.
What's more, for a service, you need to consider that when using the command, maybe it's best to stop something for a little momment to reload new settings. For example, if it's a game, you need to stop some specific service for players in a while.
In a word, without kill the process, the process ID will not change.

Delete or comment a line in multiple feature files in gitlab

I want to comment out a single line of Gherkin code in gitlab across 100+ feature files. I can do it manually if its for ~10 but we are talking about 100+ here.
I use gitlab, behat and Gherkin.
I have access to server. So, looking for some back end commands to comment the single line without even looking at the front end.
I'm sure it's possible that theres a CLI way to accomplish this, but I think your IDE is likely the best suited for this job. If it were me, I would use Replace in Path in Phpstorm - other IDE's should have similar functionality. Note most IDE's should be able to connect to a remote server as an FTP if not using VCS.

How do I permanently disable yaml files on puppet?

It has never happened before, but all of a sudden my server keeps running out of space because of these puppet reports.
Can reports=none inside the puppet.conf file, auto disable the generation of .yaml report files? Or is there a better way of doing it?
Will we ever need these .yaml files and do they affect anything if I delete them all?
Puppet has fairly good online documentation, including for historic versions of the software. You can find a good overview of the reporting feature here: https://docs.puppetlabs.com/guides/reporting.html. A bit more detail is provided in the relevant section of the manual proper, and the configuration reference provides some detail on the relevant configuration settings.
Some of the configurable aspects of reporting are:
whether agents send reports [the report parameter in the [agent] section of the config file]. This is configured on a per-agent basis. By default, they do send reports.
what the master does with the reports it receives [the reports parameter in the [master] section of the config file]. The default is to use (only) the store report handler, which dumps them to YAML files in the configured report directory.
Can reports=none inside the puppet.conf file, auto disable the generation of .yaml report files?
No 'none' handler is documented, but you can write and plug in custom report handlers, as described in the docs. A none handler ought to be trivial to write, but see below.
Or is there a better way of doing it?
I'd recommend configuring your agents to not send reports in the first place. That should be less work for all involved, human and machine. Do that by setting report = false (note: singlular "report") in the [agent] section of each agent's Puppet configuration file. You may need to restart the agents after.
Will we ever need these .yaml files and do they affect anything if I delete all of them?
They are for your benefit. If you have no use for them, then you can safely delete them.

In Azure, where does the cscfg file come from?

So in Azure, I created a cloud service, and now I want to upload a deployment. It asks for a package (sure, that's easy, a zip file) and a configuration file (.cscfg file). I understand that the .cscfg file is supposed to define the roles, network configuration, etc.
But I don't have a cscfg file. Where are they supposed to originate? Do I have to write one by hand? The documentation for that is substandard at best. Is there any way to generate one? Or do a deployment somehow that bypasses this step? My approach must be wrong on some level (unless I really do have to write one by hand, but I somehow doubt that is a typical case).
You can either rely on Visual Studio to create it or manually create with command line tools.
http://www.microsoft.com/en-us/download/details.aspx?id=15658
You can also create using msbuild:
http://msdn.microsoft.com/en-us/library/windowsazure/hh535755.aspx

Resources