hostgrep(1)

NAME
hostgrep - print lines matching hostlist

SYNOPSIS
hostgrep [OPTION]... HOSTLIST [FILE]...

DESCRIPTION
Search the files for lines matching the given hostlist. If no files are given, search the standard input. For each line, the program tries to find all hostnames and hostlists. Hostlists are then expanded to hostnames. The set of hostnames in a line is then compared to the set of hostnames given by the HOSTLIST on the command line. By default, the line is printed if any hostname from the HOSTLIST is found in the line.

OPTIONS

--all
    Print a line if all hostnames in the given HOSTLIST is found in the line.

--any
    Print a line if any hostname in the given HOSTLIST is found in the line (the default).

-h  Do not show the filename in front of matching line. This is the default if at most one FILE is given.

-H  Show the filename in front of matching lines. This is the default if two or more FILES are given.

EXAMPLES

Search for lines in an accounting file where any of the three hosts is present (as a hostname or part of a hostlist):
    hostgrep n[100-102] /var/log/slurm/accounting/2009-02-22

Search for lines in the accounting files where all of the three hosts are present (as a hostname or part of a hostlist). Do not show filenames:
    hostgrep -h n[100-102] /var/log/slurm/accounting/*

BUGS
The program has a rather naive notion of what constitutes hostnames and hostlist.

AUTHOR
Written by Kent Engström <kent@nsc.liu.se>. The program is published at http://www.nsc.liu.se/~kent/python-hostlist/

SEE ALSO
hostlist (1) The hostlist expression syntax is used by several programs developed at LLNL (https://computing.llnl.gov/linux/), for example SLURM (https://computing.llnl.gov/linux/slurm/) and Pdsh (https://computing.llnl.gov/linux/pdsh.html). See the HOSTLIST EXPRESSIONS section of the pdsh(1) manual page for a short introduction to the hostlist syntax.