API Stability Long-Term

The createLookupFileFromPackageTemplate() GraphQL mutation field may be used to create a lookup file from a package lookup file template.

For more information on lookup files, see the Lookup API reference page. You may also want to look at the Packages documentation page for related information.

Syntax

Below is the syntax for the createLookupFileFromPackageTemplate() mutation field:

graphql
createLookupFileFromPackageTemplate(
      viewName: RepoOrViewName!
      packageId: VersionedPackageSpecifier!
      lookupFileTemplateName: string!
      overrideName: string
   ): FileNameAndPath!

Below is an example of how this mutation field might be used:

Show:
graphql
mutation {
  createLookupFileFromPackageTemplate(
      viewName: "humio",
      packageId: "linux/guards@1.2.0",
      lookupFileTemplateName: "lookups.csv",
      overrideName: "my-lookup.csv",
    )
  { name, path }
}
Example Responses
Show:
json
{
  "data": {
    "createLookupFileFromPackageTemplate": {
      "name": "my-lookup.csv",
      "path": null
    }
  }
}

Given and Returned Datatypes

The given datatype RepoOrViewName and VersionedPackageSpecifier are scalar values. Look at the example above to understand better how to provide values for them.

FileNameAndPath returns two parameters. They're listed below:

Table: FileNameAndPath

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Sep 25, 2024
namestringyes Long-TermThe name of the file.
pathstring  Long-TermPaths for files can be one of two types: absolute or relative. Absolute paths start with a slash, and relative paths start without a slash, like Unix paths. Every repository or view in the system is considered a "folder" in its own right, meaning that every relative path is relative to the current view. An absolute path points to something that can be addressed from any view, and a relative path points to a file located inside the view. If there is no path, it means the file is located at your current location.