Atlantiraptor Docs

pipe

pipe accessor

Type: Accessor

Read from a VQL pipe.

NOTE: this is not the same as a windows named pipe.

A VQL pipe allows data to be generated from a VQL query, as the pipe is read, the query proceeds to feed more data to it.

Example

LET MyPipe = pipe(query={
        SELECT _value FROM range(start=0, end=10, step=1)
}, sep="\n")

SELECT read_file(filename="MyPipe", accessor="pipe")
FROM scope()

It is mostly useful for redirecting the output of one query to another without using temp files. You probably do not want to use it!

Platforms: macOS, Linux, Windows

pipe function

Type: Function

A pipe allows plugins that use files to read data from a vql query.

NOTE: this is not the same as a Windows named pipe.

This is needed to be able to use the “pipe” accessor.

Example

In the following example we create a pipe from a query which reads a log file line by line. Each line is being transformed by a regex and potentially filtered (perhaps to fix up buggy CSV implementations that generated a bad CSV).

The pipe is then fed into the parse_csv() plugin to parse each line as a csv file.

LET MyPipe = pipe(query={
    SELECT regex_replace(
      re='''^(\d{4}-\d{2}-\d{2}) (\d{2}:)''',
      replace='''${1}T${2}''', source=Line) AS Line
    FROM parse_lines(filename=IISPath)
    WHERE NOT Line =~ "^#"
  }, sep="\n")

SELECT * FROM parse_csv(
   columns=Columns, separator=" ",
   filename="MyPipe", accessor="pipe")
Argument Type Description
name string Name to call the pipe
query StoredQuery Run this query to generator data - the first column will be appended to pipe data.
sep string The separator that will be used to split each read (default: no separator will be used)

Platforms: macOS, Linux, Windows