bheisig / i-doit-cli

Access your CMDB on the command line interface
GNU Affero General Public License v3.0
13 stars 1 forks source link

Read from i-doit logbook #16

Closed bheisig closed 5 years ago

bheisig commented 6 years ago
idoitcli logbook # Read everything
idoitcli logbook 123 # Read everything about an object by its identifier
idoitcli logbook mylittleserver # Read everything about an object by its title
idoitcli logbook -n100 # Read last 100 entries
idoitcli logbook -f # Follow
idoitcli logbook --since today # Read everything since a specific date
bheisig commented 5 years ago

This feature has been implemented:

$ idoitcli logs --help
Print logs from i-doit

USAGE
    $ idoitcli logs [OPTIONS]

COMMAND OPTIONS
    -f, --follow        Start a continuous stream of logs
    --id=id             Filter logs by numeric object identifier
                        Repeat to filter by more than one identifiers
    -n limit,           Limit to last number of logs
    --number=limit
    --since=time        Filter logs since a specific date/time
                        May be everything that can be interpreted as a date/time
    --title=title       Filter logs by object title
                        Wildcards like "*" and "[ae]" are allowed
                        Repeat to filter by more than one titles

    Any combination of options is allowed.

COMMON OPTIONS
    -c FILE,            Include settings stored in a JSON-formatted
    --config=FILE       configuration file FILE; repeat option for more
                        than one FILE
    -s KEY=VALUE,       Add runtime setting KEY with its VALUE; separate
    --setting=KEY=VALUE nested keys with ".", for example "key1.key2=123";
                        repeat option for more than one KEY

    --no-colors         Do not print colored messages
    -q, --quiet         Do not output messages, only errors
    -v, --verbose       Be more verbose

    -h, --help          Print this help or information about a
                        specific command
    --version           Print version information

    -y, --yes           No user interaction required; answer questions
                        automatically with default values

EXAMPLES
    # Read all logs at once:
    $ idoitcli logs

    # Read logs about 2 objects by their identifiers:
    $ idoitcli logs --id 23 --id 42

    # Read logs about various objects by similar titles:
    $ idoitcli logs --title "host*.example.com"

    # Follow:
    $ idoitcli logs -f

    # Print only logs since today:
    $ idoitcli logs --since today

    # Or since a specific date:
    $ idoitcli logs --since 2018-01-01