File path sensors · GraphQL query

endpointPathEntryContents query

Retrieves the collected contents of one file path discovered by an EndpointPath — list discovered paths with its entries field. Returns null when the sensor never reported that path or no contents are stored for it (e.g. the sensor does not collect contents, or the file was reported deleted). The file bytes are only read from storage when the result's contentsAsString is selected; see endpointPathEntryStats for the file's stat record.

Response

Returns an EndpointPathEntryContentsPayload

Arguments

Name Description
id - ID! The EndpointPath identifier.
path - String! The absolute file path exactly as reported by the endpoint.
mockOptions - MockDataInput

Options for mock data generation. Options supported: key: "PLATFORM", value: OsPlatform

example: "mockOptions": { "options": [ { "key": "PLATFORM", "value": "WINDOWS" } ] }

Example

Query

query endpointPathEntryContents(
  $id: ID!,
  $path: String!,
  $mockOptions: MockDataInput
) {
  endpointPathEntryContents(
    id: $id,
    path: $path,
    mockOptions: $mockOptions
  ) {
    node {
      path
      contentsAsString
      contentsUrl
    }
  }
}

Variables

{
  "id": 4,
  "path": "xyz789",
  "mockOptions": MockDataInput
}

Response

{
  "data": {
    "endpointPathEntryContents": {
      "node": EndpointPathEntryContents
    }
  }
}