mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 09:58:54 +00:00
Adding osquery_scheduled table
This commit is contained in:
parent
a8506d15e8
commit
6f2afd7be8
9
osquery/tables/specs/utility/osquery_scheduled.table
Normal file
9
osquery/tables/specs/utility/osquery_scheduled.table
Normal file
@ -0,0 +1,9 @@
|
||||
table_name("osquery_scheduled")
|
||||
description("Information about the current queries that are scheduled in osquery.")
|
||||
schema([
|
||||
Column("interval", INTEGER, "The interval in seconds to run this query, not an exact interval."),
|
||||
Column("name", TEXT, "The given name for this query."),
|
||||
Column("query", TEXT, "The exact query to run."),
|
||||
])
|
||||
attributes(utility=True)
|
||||
implementation("osquery@genOsqueryScheduled")
|
@ -133,5 +133,20 @@ QueryData genOsqueryInfo(QueryContext& context) {
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
QueryData genOsqueryScheduled(QueryContext& context) {
|
||||
QueryData results;
|
||||
|
||||
ConfigDataInstance config;
|
||||
for (const auto& query : config.schedule()) {
|
||||
Row r;
|
||||
r["name"] = TEXT(query.first);
|
||||
r["query"] = TEXT(query.second.query);
|
||||
r["interval"] = INTEGER(query.second.interval);
|
||||
results.push_back(r);
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user