CERT/CC
background
background
CERT NetSA Security Suite 
Open Source Tools for Network Monitoring 
News | Downloads | Documentation | Wiki | Tooltips
SiLK 2.1.0 | YAF 1.0.0.2 | IPA 0.4.0 | fixbuf 0.8.0 | Portal 0.9.0 | RAVE 1.9.16 | iSiLK 0.1.6
IPA - Documentation
Documentation | Downloads | Release Notes


NAME

ipaquery - Print information about records in an IPA data store


SYNOPSIS

  ipaquery [--DB=DBI_URI] [--delimiter=delimiter]
        [--no-columns] [--csv]
        [--max-catalog-width=WIDTH] [--max-label-width=WIDTH]
        command [arguments]


DESCRIPTION

ipaquery prints out information about IPA catalogs and datasets.


OPTIONS

--db=DB_URI

A URI specifying the IPA data store to connect to. Due to the possible exposure of database credentials via process listings, the use of this option is discouraged. See ENVIRONMENT below for the recommended way of specifying the IPA data store URI.

--delimiter=DELIM

Specifies the character used as a field delimiter in the output. By default, ipaquery uses whitespace as the field delimiter.

--no-columns

By default, output is printed with fixed-width columns. If this switch is present, columnar output is disabled.

--csv

Output records in CSV format. This switch has the same effect as --no-columns --delimiter=,

--max-catalog-width=WIDTH

If this option is present, catalog names will be truncated at WIDTH characters. This switch is ignored if --no-columns is specified.

--max-label-width=WIDTH

If this option is present, labels will be truncated at WIDTH characters. This switch is ignored if --no-columns is specified.


COMMANDS

Currently, the following commands are supported:

catlist [prefix]

List all IPA catalogs, or those catalogs that begin with prefix

setlist catname

List all datasets which belong to the catname IPA catalog.

find query_spec

Retrieve IPA records matching query_spec from the data store (see QUERY SYNTAX below)


QUERY SYNTAX

The find command returns association records based on a simple query language. A valid query consists of one or more keyword clauses using the keywords below.

Keywords

in catalog

Return only records in the given catalog.

addr range

Return only records matching the given IP address range. See Argument Formats below for the syntax of the range argument.

label label

Return only records with the given label.

at time

Return only records valid at the given time.

before time

Return only records valid before the given time.

after time

Return only records valid after the given time.

between time and time

Return only records valid between the two given times.

Argument Formats


EXAMPLES

List Catalogs

List all catalogs in the IPA data store:

  $ ipaquery catlist

List all catalogs that begin with the string "dns"

  $ ipaquery catlist dns

List Datasets

List all datasets in the "dns.primary" catalog:

  $ ipaquery setlist dns.primary

Query Records

Show all records in the country code catalog "geo.country":

  $ ipaquery find in geo.country

Show all records in the country code catalog on a specific date:

  $ ipaquery find in geo.country at 2009-01-20

Show all records in the country code catalog with the label "us":

  $ ipaquery find label us in geo.country

Show everything IPA knows about a single IP address:

  $ ipaquery find addr 10.1.1.1

Show everything IPA knows about a single IP address at a specific date/time:

  $ ipaquery find addr 10.1.1.1 at 2009-01-20

Show everything IPA knows about a single IP address before a given date:

  $ ipaquery find addr 10.1.1.1 before 2009-01-20

Show everything IPA knows about a single IP address after a given date:

  $ ipaquery find addr 10.1.1.1 after 2009-01-20

Show all records in geo.country, within a specific time period, in the 10.0.0.0/8 CIDR block, with label "us":

  $ ipaquery find in geo.country \
      between 2009-01-20:12:30 and 2009-01-21:12:30 \
      addr 10.0.0.0/8 label us


ENVIRONMENT

IPA_DB_URI

A URI specifying the location of (and credentials for) the IPA data store. The format of this URI is driver://user:password@hostname/database, e.g.:

    postgresql://ipauser:secret@database-server.domain.com/ipa


NOTES

Currently, only the PostgreSQL database driver is supported.


SEE ALSO

ipaimport(1), ipaexport(1)