You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.6 KiB

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/zq-cmd.R
\name{zq_cmd}
\alias{zq_cmd}
\title{Execute a zq command line}
\usage{
zq_cmd(args, parse = TRUE)
}
\arguments{
\item{args}{see \code{\link[=system2]{system2()}}}
\item{parse}{if \code{TRUE} (the default) the output of the command line call
will be parsed using \code{\link[ndjson:stream_in]{ndjson::stream_in()}}. There are some combinations
of \code{zq} flags that will never return ndjson output. There are heuristics
in place to detect this, but you can deliberately force the function
to return raw command line output by setting this to \code{FALSE}.}
}
\value{
\code{data.table} (if output is parseable); character vector (if output is
either not parseable or \code{parse} equals \code{FALSE}); or \code{NULL} in the
event an error occurred when processing the \code{zq} command line.
}
\description{
zq is a command-line tool for processing logs. It applies boolean logic to
filter each log value, optionally computes analytics and transformations,
and returns results that can be consumed programmatically.\cr
\cr
This function takes command line arguments to be used with \code{zq} (
in the form \code{\link[=system2]{system2()}} uses) and reads the results into a
data frame (it is actually a \code{data.table}).\cr
\cr
If the environment variable \code{ZQ_PATH} is not set or invalid, this function
will attempt to guess the \code{zq} binary path.\cr
\cr
Do not specify an output format as \verb{-f ndjson} is added by default.
}
\examples{
zq_cmd(
c(
'"* | cut ts,id.orig_h,id.orig_p"', # note the quotes
system.file("logs", "conn.log.gz", package = "brimr")
)
)
}