Skip to content

Commit

Permalink
Spell check docs
Browse files Browse the repository at this point in the history
- Ran spell check over all the Sphinx docs and ksconf.commands.* modules.
- Tweaked Splunk app name (label) again and set author per notes in app spec.
- Very minor wording fixes
  • Loading branch information
lowell80 committed Feb 13, 2019
1 parent caab53b commit 1989fe2
Show file tree
Hide file tree
Showing 26 changed files with 56 additions and 59 deletions.
10 changes: 5 additions & 5 deletions docs/source/cheatsheet.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Cheat Sheet
.. I guess technically this is somewhere between a cheatsheet and tutorial??? but it works for now
Here's a quick rundown of a bunch of frequently used ``ksconf`` comamnds that often come in handy.
Here's a quick rundown of handy ``ksconf`` commands:


.. note::
Expand Down Expand Up @@ -37,7 +37,7 @@ Sorting content
~~~~~~~~~~~~~~~

To create a normalized version a configuration file, to make it easier to merging with
:command:`git`, run an inplace sort like so:
:command:`git`, run an in-place sort like so:

.. code-block:: sh
Expand Down Expand Up @@ -121,7 +121,7 @@ Migrating content between apps
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Say you want to move a bunch of savedsearch from ``search`` into a more appropriate app. First create a file that list all the names of your searches (one per line) in :file:`corp_searches.txt`
Say you want to move a bunch of savedsearches from ``search`` into a more appropriate app. First create a file that list all the names of your searches (one per line) in :file:`corp_searches.txt`

.. code-block:: sh
Expand All @@ -140,7 +140,7 @@ And now, to avoid duplication and confusion, you want to remove that exact same
mv search/local/savedsearches.conf \
/my/backup/location/search-savedsearches-$(date +%Y%M%D).conf
# Move the update file inplace
# Move the update file in place
mv search/local/savedsearches.conf.NEW search/local/savedsearches.conf
Expand All @@ -161,7 +161,7 @@ You're working from the new server and would generally prefer to keep whatever o
(This is because some of your users copied over some of their critical alerts manually while waiting for the migration to complete, and they've made updates they don't want to lose.)


After stopping splunk on the new server, run the following commands.
After stopping Splunk on the new server, run the following commands.


.. code-block:: sh
Expand Down
2 changes: 1 addition & 1 deletion docs/source/cmd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The ksconf command documentation is provided in the following ways:
1. A detailed listing of each sub-command is provided in this section.
This includes relevant background descriptions, typical use cases, examples, and discussion of
relevant topics. An expanded descriptions of CLI arguments and their usage is provided here.
If you've not used a particual command before, start here.
If you've not used a particular command before, start here.
2. The :doc:`Command line reference<dyn/cli>` provides a quick an convenient reference when
the command line is unavailable. The same information is available by typing ``ksconf --help``.
This is most helpful if you're already familiar with a command, but need a quick refresher.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/cmd_combine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ksconf combine

--banner -b : @after
For other on-going *combine* operations, it's helpful to inform any .conf file readers or potential editors that the file is automatically generated and therefore could be overwritten again.
For one-time *combine* operations, the default banner can be suppresed by passing in an empty string (``''``)
For one-time *combine* operations, the default banner can be suppressed by passing in an empty string (``''``)


You may have noticed similarities between the ``combine`` and :ref:`merge <ksconf_cmd_merge>`
Expand Down Expand Up @@ -84,7 +84,7 @@ In this structure, you can see several layers of configurations at play:

1. The ``10-upstream`` layer appears to be the version of the default folder that shipped with
the Cisco app.
2. The ``20-my-org`` layer is small and only contains tweaks to a few savedsearch entires.
2. The ``20-my-org`` layer is small and only contains tweaks to a few saved search entires.
3. The ``50-splunk-admin`` layer represents local settings changes to specify index
configurations, and to augment the macros and transformations that ship with the default app.
4. And finally, ``70-firewall-admins`` contains some additional view (2 new, and 1 existing).
Expand Down
4 changes: 0 additions & 4 deletions docs/source/cmd_diff.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
ksconf diff
===========

.. topic:: Summary

Compare settings differences between two .conf files
ignoring spacing and sort order

.. argparse::
:module: ksconf.__main__
Expand Down
2 changes: 1 addition & 1 deletion docs/source/cmd_filter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Can I do the same thing with standard unix tools?

Sure, go for it!

Yes, there's significan't overlap with the filter command and what you can do with :command:`grep`,
Yes, there's significant overlap with the filter command and what you can do with :command:`grep`,
:command:`awk`, or :command:`sed`. Much of that is on purpose, and in fact some command line
arguments were borrowed.

Expand Down
2 changes: 2 additions & 0 deletions docs/source/cmd_merge.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ ksconf merge
:func: build_cli_parser
:path: merge
:nodefault:

.. TODO: Add an examples or two here.
6 changes: 3 additions & 3 deletions docs/source/cmd_minimize.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ ksconf minimize
--output : @after
This option can be used to *preview* the actual changes.
Sometimes if ``--dry-run`` mode produces too much output, it's helpful to look at the
acutal minimized version of the file in concrete form (rather than a relative format, like
actual minimized version of the file in concrete form (rather than a relative format, like
a diff. This may also be helpful in other workflows.

--explode-default -E
Expand All @@ -31,9 +31,9 @@ ksconf minimize
technically redundant. This is often true of boolean flags like ``disabled`` or input
intervals.

Note that if Splunk updates the stanzas itself, then your value may not longer be preseved.
Note that if Splunk updates the stanzas itself, then your value may not longer be preserved.
This is simply the way Splunk updates conf files.
See :ref:`How Splunk write to conf files <splunk conf updates>` for more backgound.
See :ref:`How Splunk write to conf files <splunk conf updates>` for more background.

Example usage
^^^^^^^^^^^^^
Expand Down
6 changes: 3 additions & 3 deletions docs/source/cmd_promote.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ Here are some of the safety mechanisms that exist, because ksconf tries hard not
Any attempts to promote content from a file to itself are prevented.
While logically no one would want to do this, in practice having a clear error message saves time and confusion.

Basename check
The *SOURCE* and *TARGET* should share the same basename.
Base name check
The *SOURCE* and *TARGET* should share the same base name.
In other words, trying to promote from :file:`inputs.conf` into :file:`props.conf` (due to a typo) will be prevented.
This matters more in batch mode.
In interactive mode, it should be pretty obvious that the type of entries don't make sense and therefore the user can simply exit without saving.
Expand All @@ -77,7 +77,7 @@ Here are some of the safety mechanisms that exist, because ksconf tries hard not
.. note::

Unfortunately the unit testing coverage for the ``promote`` command is quite low.
This is primarily because I haven't yet figured out how to handle unitteesting for interactive CLI tools (as this is the only interactive command to date.)
This is primarily because I haven't yet figured out how to handle unit testing for interactive CLI tools (as this is the only interactive command to date.)
I'm also not sure how much the UI may change;
Any assistance in this area would be greatly appreciated.

Expand Down
2 changes: 1 addition & 1 deletion docs/source/cmd_unarchive.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ksconf unarchive
If a git commit is incorrect, simply roll it back with ``git reset`` or fix it with a
``git commit --amend`` before the changes are pushed anywhere else. There's no native
``--dry-run`` or undo for unarchive mode because that's why you're using git in the first
place, right? (And such features would require significant overhead and unittesting)
place, right? (And such features would require significant overhead and unit testing)

SPL
Supports tarballs (.tar.gz, .spl), and less-common zip files (.zip)
Expand Down
14 changes: 7 additions & 7 deletions docs/source/dyn/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ ksconf diff
This command ignores textual differences (like order, spacing, and comments) and
focuses strictly on comparing stanzas, keys, and values. Note that spaces
within any given value will be compared. Multiline fields are compared in are
within any given value will be compared. Multi-line fields are compared in are
compared in a more traditional 'diff' output so that long savedsearches and
macros can be compared more easily.
Expand Down Expand Up @@ -322,8 +322,8 @@ ksconf merge
-h, --help show this help message and exit
--target FILE, -t FILE
Save the merged configuration files to this target
file. If not provided. the the merged conf is written
to standard output.
file. If not provided. the merged conf is written to
standard output.
--dry-run, -D Enable dry-run mode. Instead of writing to TARGET,
preview changes in 'diff' format. If TARGET doesn't
exist, then show the merged file.
Expand Down Expand Up @@ -416,7 +416,7 @@ ksconf sort
Sort a Splunk .conf file. Sort has two modes: (1) by default, the sorted
config file will be echoed to the screen. (2) the config files are updated
inplace when the -i' option is used.
in-place when the -i' option is used.
Manually managed conf files can be blacklisted by add a comment containing the
string 'KSCONF-NO-SORT' to the top of any .conf file.
Expand Down Expand Up @@ -486,10 +486,10 @@ ksconf rest-export
this is derived from CONF, but sometime it's helpful
set this explicitly. Can be any valid Splunk conf file
type, example include 'app', 'props', 'tags',
'savesdearches', and so on.
'savedsearches', and so on.
--extra-args EXTRA_ARGS
Extra arguments to pass to all CURL commands. Quote
arguments on the commandline to prevent confusion
arguments on the command line to prevent confusion
between arguments to ksconf vs curl.
Output Control:
Expand Down Expand Up @@ -539,7 +539,7 @@ ksconf unarchive
a dynamic default directory that's created and managed
by the 'combine' mode.
--exclude EXCLUDE, -e EXCLUDE
Add a file pattern to exclude. Splunk's psudo-glob
Add a file pattern to exclude. Splunk's pseudo-glob
patterns are supported here. '*' for any non-directory
match, '...' for ANY (including directories), and '?'
for a single character.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Welcome to KSCONF!

KSCONF in a modular command line tool for Splunk admins and app developers.
It's quick and easy to get started with basic commands and grow into the more advanced commands as needed.
Check out our growing body of documentation to help smooth your transition into a more-manged Splunk
environment, or explore ways to integrate ksconf's capabilities into your existing workflow.
Thanks for checking out out expanding body of documentation to help smooth your transition to a better-manged Splunk
environment, or explore ways to integrate ksconf capabilities into your existing workflow.

No matter where you're starting from, we think ksconf can help! We're glad your here. Let us
know if there's anything we can do to help along your journey.
Expand Down
8 changes: 4 additions & 4 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Installation Guide
KSCONF can be installed either as a Splunk app or a Python package. Picking the option that's right
for you is typically fairly easy.

Unless you have experence with Python packaging or are planning on customizing or extending ksconf
Unless you have experience with Python packaging or are planning on customizing or extending ksconf
then :ref:`Splunk app <install_splunk_app>` is likely the best place for you to start. If you go
with the native Python option, then you have many additional decisions to make.

Expand Down Expand Up @@ -117,14 +117,14 @@ If you're on a Mac or Linux, and would like to enable bash completion, run these
pip install argcomplete
echo 'eval "$(register-python-argcomplete ksconf)"' >> ~/.bashrc
(Currently for Splunk APP installs; not because it can't work, but because it's not documented or
(Currently not available for Splunk APP installs; not because it can't work, but because it's not documented or
tested yet. Pull request welcome.)

Ran into issues?
~~~~~~~~~~~~~~~~

If you run into any issues, then please dive into the :doc:`install_advanced`. Much time and effort
was placed into compiling that information from all the scenarios we encounted, so please check it
was placed into compiling that information from all the scenarios we encountered, so please check it
out. You may want to start under the :ref:`python_troubleshooting`.


Expand Down Expand Up @@ -174,7 +174,7 @@ The output should look something like this:
Copyright (c) 2019 Kintyre Solutions, Inc, all rights reserved.
Licensed under Apache Public License v2

kintyre_splunk_conf (0.5.5)
kintyre_splunk_conf (0.6.2)

Commands:
check (stable)
Expand Down
4 changes: 2 additions & 2 deletions docs/source/install_advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use Splunk's embedded Python. For everyone else, please start with the one-liner
- ``LD_LIBARY``
- RedHat Software Collections

If this list seems daungting, head over to :ref:`install_splunk_app`. There's no shame in it.
If this list seems daunting, head over to :ref:`install_splunk_app`. There's no shame in it.


.. contents::
Expand Down Expand Up @@ -197,7 +197,7 @@ Typical embedded Splunk install example:
Reasons why this is a non-ideal install approach:
- Lower performance since all python files live in a zip file, and precompiled version's can be
- Lower performance since all python files live in a zip file, and pre-compiled version's can be
cached.
- No standard install pathway (doesn't use pip); user must manually copy the executable into place.
- Uses a non-standard build process. (May not be a big deal, but could cause things to break in
Expand Down
4 changes: 2 additions & 2 deletions docs/source/intro.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ natively).
.. note:: **What KSCONF is not**

Ksconf does *not* replace your existing Splunk deployment mechanisms or version control tools.
The goal is to complement and extend, not replace, the workflow that work for you.
The goal is to complement and extend, not replace, the workflow that works for you.


Design principles
Expand All @@ -39,7 +39,7 @@ Design principles

**Embrace automated testing.**
It's impractical to check every scenarios between each release, but significant work has gone
into unittesting the CLI to avoid breaks between releases.
into unit testing the CLI to avoid breakage.


Common uses for ksconf
Expand Down
2 changes: 1 addition & 1 deletion docs/source/known_issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ General

- File encoding issues:
- Byte order markers and specific encodings are NOT preserved. All file
will be writen out as UTF-8, by default.
will be written out as UTF-8, by default.


Splunk app
Expand Down
6 changes: 3 additions & 3 deletions docs/source/random.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,21 @@ For example,
2. Modified stanzas are removed from the current position in the .conf file and moved to the bottom.
3. Stanzas are typically re-written sorted in attribute order. (Or is it the same as #2? updated
attributes are written to the bottom. *Note to editor: check on this*)
4. Sometimes boolean values persist in unexpected ways. (Primarily this is because there's mor
4. Sometimes boolean values persist in unexpected ways. (Primarily this is because there's more
than one way to represent them textually, and that textual representation is different from
what's stored in default)

Essentially, splunk will always "minimize" the conf file at each any every update. This is because
Splunk internally keeps track of the final representation of the entire stanza (in memory), and only
when it's written to disk does Splunk care about the the current contents of the local file. In
when it's written to disk does Splunk care about the current contents of the local file. In
fact, Splunk re-reads the conf file immediately before updating it. This is why, if you've made a
local changes, and forgot to reload, Splunk will typically not lose your change (unless you've
update the same attribute both places... I mean, it's not magic.)


.. tip:: Don't believe me? Try it yourself.

To prove that it works this way, simply find a savedsearch that you modified from any app that
To prove that it works this way, simply find a saved search that you modified from any app that
you installed. Look at the local conf file and observe your changes. Now go edit the saved
search and restore some attribute to it's original value (the most obvious one here would be the
``search`` attribute), but that's tricky if it's multiple lines. Now go look at the local conf
Expand Down
2 changes: 1 addition & 1 deletion ksconf/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def __repr__(self): # pragma: no cover
class DescriptionFormatterNoReST(argparse.HelpFormatter):
@staticmethod
def strip_simple_rest(s):
# No hanling of embedded backticks for now... let's keep this simple
# No handling of embedded backticks for now... let's keep this simple
import re
# Replace literals ``X`` with single quote version: 'X'
s = re.sub(r'``([^`]*)``', r"'\1'", s)
Expand Down
2 changes: 1 addition & 1 deletion ksconf/commands/diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DiffCmd(KsconfCmd):
This command ignores textual differences (like order, spacing, and comments) and
focuses strictly on comparing stanzas, keys, and values. Note that spaces
within any given value will be compared. Multiline fields are compared in are
within any given value will be compared. Multi-line fields are compared in are
compared in a more traditional 'diff' output so that long savedsearches and
macros can be compared more easily.
""")
Expand Down
2 changes: 1 addition & 1 deletion ksconf/commands/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def register_args(self, parser):
type=ConfFileType("r+", "none", parse_profile=PARSECONF_STRICT),
default=ConfFileProxy("<stdout>", "w", self.stdout), help=dedent("""\
Save the merged configuration files to this target file.
If not provided. the the merged conf is written to standard output.""")
If not provided. the merged conf is written to standard output.""")
).completer = conf_files_completer
parser.add_argument("--dry-run", "-D", default=False, action="store_true", help=dedent("""\
Enable dry-run mode.
Expand Down
6 changes: 3 additions & 3 deletions ksconf/commands/minimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Example workflow:
1. cp default/props.conf local/props.conf
2. vi local/props.conf (edit JUST the lines you want to change)
3. splconf minimize --target=local/props.conf default/props.conf
3. ksconf minimize --target=local/props.conf default/props.conf
(You could take this a step further by appending "$SPLUNK_HOME/system/default/props.conf"
and removing any SHOULD_LINEMERGE = true entries (for example)
Expand Down Expand Up @@ -114,8 +114,8 @@ def run(self, args):

minz_cfg = dict(local_cfg)

# This may be a bit too simplistic. Weird interplay may exit between if [default] stanza
# and ocal [Upstream] stanza line up, but [Upstream] in our default file does not.
# This may be a bit too simplistic. Weird interplay may exists between a [default] stanza
# and local [Upstream] stanza line up, but [Upstream] in our default file does not.
# XXX: Add a unit test!

diffs = compare_cfgs(default_cfg, local_cfg, allow_level0=False)
Expand Down
2 changes: 1 addition & 1 deletion ksconf/commands/promote.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def run(self, args):

if args.mode == "ask":
# Show a summary of how many new stanzas would be copied across; how many key changes.
# ANd either accept all (batch) or pick selectively (batch)
# And either accept all (batch) or pick selectively (batch)
delta = compare_cfgs(cfg_tgt, cfg_src, allow_level0=False)
delta = [op for op in delta if op.tag != DIFF_OP_DELETE]
summarize_cfg_diffs(delta, self.stderr)
Expand Down

0 comments on commit 1989fe2

Please sign in to comment.