Adding osquery_scheduled table

This commit is contained in:
Javier Marcos 2015-04-16 14:48:21 -07:00
parent a8506d15e8
commit 6f2afd7be8
2 changed files with 24 additions and 0 deletions

View 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")

View File

@ -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;
}
}
}