@perses-dev/splunk-plugin 0.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +60 -0
- package/__mf/css/async/7.85c2cbf6.css +1 -0
- package/__mf/font/inter-cyrillic-300-normal.432f2b21.woff +0 -0
- package/__mf/font/inter-cyrillic-300-normal.9da91009.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.372704ff.woff2 +0 -0
- package/__mf/font/inter-cyrillic-400-normal.a6b6ef6f.woff +0 -0
- package/__mf/font/inter-cyrillic-500-normal.7c15bba8.woff2 +0 -0
- package/__mf/font/inter-cyrillic-500-normal.b9f8c929.woff +0 -0
- package/__mf/font/inter-cyrillic-600-normal.2f42892a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-600-normal.c3987adc.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.93eba3c3.woff +0 -0
- package/__mf/font/inter-cyrillic-700-normal.e9e5b2dc.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.f285bd7a.woff2 +0 -0
- package/__mf/font/inter-cyrillic-900-normal.ffbd8a3a.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.95bb9038.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-300-normal.cfc143a9.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.2a31c04b.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-400-normal.f572b170.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.5a6bb1da.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-500-normal.fe0d9b14.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.ecbdecad.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-600-normal.f7b3c15b.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.4b4022a6.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-700-normal.74b516d2.woff2 +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.9970ddb5.woff +0 -0
- package/__mf/font/inter-cyrillic-ext-900-normal.a0d59adc.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.0d7be683.woff2 +0 -0
- package/__mf/font/inter-greek-300-normal.8f0b988e.woff +0 -0
- package/__mf/font/inter-greek-400-normal.cc58c11b.woff +0 -0
- package/__mf/font/inter-greek-400-normal.d7020e3c.woff2 +0 -0
- package/__mf/font/inter-greek-500-normal.d9a33207.woff +0 -0
- package/__mf/font/inter-greek-500-normal.f41f43db.woff2 +0 -0
- package/__mf/font/inter-greek-600-normal.4ec0c1c1.woff +0 -0
- package/__mf/font/inter-greek-600-normal.cc532937.woff2 +0 -0
- package/__mf/font/inter-greek-700-normal.5ec6c758.woff +0 -0
- package/__mf/font/inter-greek-700-normal.97f0eeeb.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.46b66369.woff2 +0 -0
- package/__mf/font/inter-greek-900-normal.9ae3a3c5.woff +0 -0
- package/__mf/font/inter-greek-ext-300-normal.10247a66.woff2 +0 -0
- package/__mf/font/inter-greek-ext-300-normal.4668e5cb.woff +0 -0
- package/__mf/font/inter-greek-ext-400-normal.4ce1df5d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-400-normal.88ede1ea.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.7a4aa726.woff +0 -0
- package/__mf/font/inter-greek-ext-500-normal.cbd51e2d.woff2 +0 -0
- package/__mf/font/inter-greek-ext-600-normal.089a95ee.woff +0 -0
- package/__mf/font/inter-greek-ext-600-normal.1f33d317.woff2 +0 -0
- package/__mf/font/inter-greek-ext-700-normal.31f1075d.woff +0 -0
- package/__mf/font/inter-greek-ext-700-normal.827cd618.woff2 +0 -0
- package/__mf/font/inter-greek-ext-900-normal.531bcee7.woff +0 -0
- package/__mf/font/inter-greek-ext-900-normal.8a9b36b9.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.15fb600d.woff2 +0 -0
- package/__mf/font/inter-latin-300-normal.6f95f590.woff +0 -0
- package/__mf/font/inter-latin-400-normal.2c7a775c.woff +0 -0
- package/__mf/font/inter-latin-400-normal.ef6d3f52.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.b7b43ace.woff2 +0 -0
- package/__mf/font/inter-latin-500-normal.cb4c8ceb.woff +0 -0
- package/__mf/font/inter-latin-600-normal.8fb1a964.woff2 +0 -0
- package/__mf/font/inter-latin-600-normal.ce0f5f43.woff +0 -0
- package/__mf/font/inter-latin-700-normal.953b7aa5.woff2 +0 -0
- package/__mf/font/inter-latin-700-normal.9c21d4dc.woff +0 -0
- package/__mf/font/inter-latin-900-normal.2a8028ec.woff2 +0 -0
- package/__mf/font/inter-latin-900-normal.fa252135.woff +0 -0
- package/__mf/font/inter-latin-ext-300-normal.167cc8c9.woff2 +0 -0
- package/__mf/font/inter-latin-ext-300-normal.f695be66.woff +0 -0
- package/__mf/font/inter-latin-ext-400-normal.32a25442.woff2 +0 -0
- package/__mf/font/inter-latin-ext-400-normal.4edcaace.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.a19a84a6.woff +0 -0
- package/__mf/font/inter-latin-ext-500-normal.d9b491de.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.38b075d8.woff2 +0 -0
- package/__mf/font/inter-latin-ext-600-normal.49faa47a.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.93534b50.woff +0 -0
- package/__mf/font/inter-latin-ext-700-normal.b63daa1a.woff2 +0 -0
- package/__mf/font/inter-latin-ext-900-normal.0efdb307.woff +0 -0
- package/__mf/font/inter-latin-ext-900-normal.9c0fc2c7.woff2 +0 -0
- package/__mf/font/inter-vietnamese-300-normal.aad496d8.woff +0 -0
- package/__mf/font/inter-vietnamese-300-normal.ad9ef503.woff2 +0 -0
- package/__mf/font/inter-vietnamese-400-normal.a9dd2faf.woff +0 -0
- package/__mf/font/inter-vietnamese-400-normal.de4fc44f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.7c0a695f.woff2 +0 -0
- package/__mf/font/inter-vietnamese-500-normal.a3a73b95.woff +0 -0
- package/__mf/font/inter-vietnamese-600-normal.9d518599.woff2 +0 -0
- package/__mf/font/inter-vietnamese-600-normal.c5ce3fcb.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.bc68b199.woff +0 -0
- package/__mf/font/inter-vietnamese-700-normal.faf12809.woff2 +0 -0
- package/__mf/font/inter-vietnamese-900-normal.2b782045.woff +0 -0
- package/__mf/font/inter-vietnamese-900-normal.e639b65a.woff2 +0 -0
- package/__mf/js/Splunk.d622dd09.js +7 -0
- package/__mf/js/async/121.444e1abe.js +2 -0
- package/__mf/js/async/121.444e1abe.js.LICENSE.txt +9 -0
- package/__mf/js/async/177.cfdf2ea5.js +1 -0
- package/__mf/js/async/181.fee3676d.js +2 -0
- package/__mf/js/async/181.fee3676d.js.LICENSE.txt +9 -0
- package/__mf/js/async/278.171d6548.js +24 -0
- package/__mf/js/async/278.171d6548.js.LICENSE.txt +44 -0
- package/__mf/js/async/386.9514a8a7.js +2 -0
- package/__mf/js/async/386.9514a8a7.js.LICENSE.txt +9 -0
- package/__mf/js/async/413.0cd939f5.js +1 -0
- package/__mf/js/async/470.3f481d24.js +2 -0
- package/__mf/js/async/470.3f481d24.js.LICENSE.txt +19 -0
- package/__mf/js/async/667.bb282078.js +1 -0
- package/__mf/js/async/7.ed3f1592.js +7 -0
- package/__mf/js/async/7.ed3f1592.js.LICENSE.txt +64 -0
- package/__mf/js/async/732.69245394.js +139 -0
- package/__mf/js/async/732.69245394.js.LICENSE.txt +46 -0
- package/__mf/js/async/941.8fe72889.js +2 -0
- package/__mf/js/async/941.8fe72889.js.LICENSE.txt +9 -0
- package/__mf/js/async/963.f1d8b579.js +1 -0
- package/__mf/js/async/982.8a88a864.js +10 -0
- package/__mf/js/async/982.8a88a864.js.LICENSE.txt +26 -0
- package/__mf/js/async/__federation_expose_SplunkDatasource.f30e66ce.js +2 -0
- package/__mf/js/async/__federation_expose_SplunkDatasource.f30e66ce.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_SplunkLogQuery.df0414d6.js +2 -0
- package/__mf/js/async/__federation_expose_SplunkLogQuery.df0414d6.js.LICENSE.txt +9 -0
- package/__mf/js/async/__federation_expose_SplunkTimeSeriesQuery.fa50234a.js +2 -0
- package/__mf/js/async/__federation_expose_SplunkTimeSeriesQuery.fa50234a.js.LICENSE.txt +9 -0
- package/__mf/js/async/lib-router.1acd2c34.js +2 -0
- package/__mf/js/async/lib-router.1acd2c34.js.LICENSE.txt +32 -0
- package/__mf/js/main.39e2a771.js +7 -0
- package/lib/bootstrap.d.ts +2 -0
- package/lib/bootstrap.d.ts.map +1 -0
- package/lib/bootstrap.js +20 -0
- package/lib/bootstrap.js.map +1 -0
- package/lib/cjs/bootstrap.js +27 -0
- package/lib/cjs/datasources/index.js +30 -0
- package/lib/cjs/datasources/splunk-datasource/SplunkDatasource.js +69 -0
- package/lib/cjs/datasources/splunk-datasource/SplunkDatasourceEditor.js +71 -0
- package/lib/cjs/datasources/splunk-datasource/index.js +32 -0
- package/lib/cjs/datasources/splunk-datasource/splunk-datasource-types.js +16 -0
- package/lib/cjs/env.d.js +14 -0
- package/lib/cjs/getPluginModule.js +39 -0
- package/lib/cjs/index-federation.js +55 -0
- package/lib/cjs/index.js +39 -0
- package/lib/cjs/model/index.js +31 -0
- package/lib/cjs/model/splunk-client-types.js +16 -0
- package/lib/cjs/model/splunk-client.js +151 -0
- package/lib/cjs/queries/constants.js +25 -0
- package/lib/cjs/queries/index.js +31 -0
- package/lib/cjs/queries/splunk-log-query/SplunkLogQuery.js +43 -0
- package/lib/cjs/queries/splunk-log-query/SplunkLogQueryEditor.js +95 -0
- package/lib/cjs/queries/splunk-log-query/get-splunk-log-data.js +127 -0
- package/lib/cjs/queries/splunk-log-query/index.js +33 -0
- package/lib/cjs/queries/splunk-log-query/log-query-plugin-interface.js +16 -0
- package/lib/cjs/queries/splunk-log-query/splunk-log-query-types.js +16 -0
- package/lib/cjs/queries/splunk-time-series-query/SplunkTimeSeriesQuery.js +43 -0
- package/lib/cjs/queries/splunk-time-series-query/SplunkTimeSeriesQueryEditor.js +95 -0
- package/lib/cjs/queries/splunk-time-series-query/get-splunk-time-series-data.js +106 -0
- package/lib/cjs/queries/splunk-time-series-query/index.js +33 -0
- package/lib/cjs/queries/splunk-time-series-query/splunk-time-series-query-types.js +16 -0
- package/lib/cjs/setup-tests.js +19 -0
- package/lib/datasources/index.d.ts +2 -0
- package/lib/datasources/index.d.ts.map +1 -0
- package/lib/datasources/index.js +15 -0
- package/lib/datasources/index.js.map +1 -0
- package/lib/datasources/splunk-datasource/SplunkDatasource.d.ts +5 -0
- package/lib/datasources/splunk-datasource/SplunkDatasource.d.ts.map +1 -0
- package/lib/datasources/splunk-datasource/SplunkDatasource.js +61 -0
- package/lib/datasources/splunk-datasource/SplunkDatasource.js.map +1 -0
- package/lib/datasources/splunk-datasource/SplunkDatasource.test.d.ts +2 -0
- package/lib/datasources/splunk-datasource/SplunkDatasource.test.d.ts.map +1 -0
- package/lib/datasources/splunk-datasource/SplunkDatasourceEditor.d.ts +9 -0
- package/lib/datasources/splunk-datasource/SplunkDatasourceEditor.d.ts.map +1 -0
- package/lib/datasources/splunk-datasource/SplunkDatasourceEditor.js +63 -0
- package/lib/datasources/splunk-datasource/SplunkDatasourceEditor.js.map +1 -0
- package/lib/datasources/splunk-datasource/index.d.ts +4 -0
- package/lib/datasources/splunk-datasource/index.d.ts.map +1 -0
- package/lib/datasources/splunk-datasource/index.js +17 -0
- package/lib/datasources/splunk-datasource/index.js.map +1 -0
- package/lib/datasources/splunk-datasource/splunk-datasource-types.d.ts +6 -0
- package/lib/datasources/splunk-datasource/splunk-datasource-types.d.ts.map +1 -0
- package/lib/datasources/splunk-datasource/splunk-datasource-types.js +15 -0
- package/lib/datasources/splunk-datasource/splunk-datasource-types.js.map +1 -0
- package/lib/env.d.js +15 -0
- package/lib/env.d.js.map +1 -0
- package/lib/getPluginModule.d.ts +6 -0
- package/lib/getPluginModule.d.ts.map +1 -0
- package/lib/getPluginModule.js +28 -0
- package/lib/getPluginModule.js.map +1 -0
- package/lib/index-federation.d.ts +1 -0
- package/lib/index-federation.d.ts.map +1 -0
- package/lib/index-federation.js +15 -0
- package/lib/index-federation.js.map +1 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +18 -0
- package/lib/index.js.map +1 -0
- package/lib/model/index.d.ts +3 -0
- package/lib/model/index.d.ts.map +1 -0
- package/lib/model/index.js +16 -0
- package/lib/model/index.js.map +1 -0
- package/lib/model/splunk-client-types.d.ts +50 -0
- package/lib/model/splunk-client-types.d.ts.map +1 -0
- package/lib/model/splunk-client-types.js +15 -0
- package/lib/model/splunk-client-types.js.map +1 -0
- package/lib/model/splunk-client.d.ts +40 -0
- package/lib/model/splunk-client.d.ts.map +1 -0
- package/lib/model/splunk-client.js +126 -0
- package/lib/model/splunk-client.js.map +1 -0
- package/lib/queries/constants.d.ts +4 -0
- package/lib/queries/constants.d.ts.map +1 -0
- package/lib/queries/constants.js +17 -0
- package/lib/queries/constants.js.map +1 -0
- package/lib/queries/index.d.ts +3 -0
- package/lib/queries/index.d.ts.map +1 -0
- package/lib/queries/index.js +16 -0
- package/lib/queries/index.js.map +1 -0
- package/lib/queries/splunk-log-query/SplunkLogQuery.d.ts +4 -0
- package/lib/queries/splunk-log-query/SplunkLogQuery.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/SplunkLogQuery.js +35 -0
- package/lib/queries/splunk-log-query/SplunkLogQuery.js.map +1 -0
- package/lib/queries/splunk-log-query/SplunkLogQuery.test.d.ts +2 -0
- package/lib/queries/splunk-log-query/SplunkLogQuery.test.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/SplunkLogQueryEditor.d.ts +7 -0
- package/lib/queries/splunk-log-query/SplunkLogQueryEditor.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/SplunkLogQueryEditor.js +87 -0
- package/lib/queries/splunk-log-query/SplunkLogQueryEditor.js.map +1 -0
- package/lib/queries/splunk-log-query/get-splunk-log-data.d.ts +4 -0
- package/lib/queries/splunk-log-query/get-splunk-log-data.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/get-splunk-log-data.js +119 -0
- package/lib/queries/splunk-log-query/get-splunk-log-data.js.map +1 -0
- package/lib/queries/splunk-log-query/index.d.ts +5 -0
- package/lib/queries/splunk-log-query/index.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/index.js +18 -0
- package/lib/queries/splunk-log-query/index.js.map +1 -0
- package/lib/queries/splunk-log-query/log-query-plugin-interface.d.ts +23 -0
- package/lib/queries/splunk-log-query/log-query-plugin-interface.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/log-query-plugin-interface.js +15 -0
- package/lib/queries/splunk-log-query/log-query-plugin-interface.js.map +1 -0
- package/lib/queries/splunk-log-query/splunk-log-query-types.d.ts +11 -0
- package/lib/queries/splunk-log-query/splunk-log-query-types.d.ts.map +1 -0
- package/lib/queries/splunk-log-query/splunk-log-query-types.js +15 -0
- package/lib/queries/splunk-log-query/splunk-log-query-types.js.map +1 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQuery.d.ts +4 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQuery.d.ts.map +1 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQuery.js +35 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQuery.js.map +1 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQuery.test.d.ts +2 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQuery.test.d.ts.map +1 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQueryEditor.d.ts +7 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQueryEditor.d.ts.map +1 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQueryEditor.js +87 -0
- package/lib/queries/splunk-time-series-query/SplunkTimeSeriesQueryEditor.js.map +1 -0
- package/lib/queries/splunk-time-series-query/get-splunk-time-series-data.d.ts +4 -0
- package/lib/queries/splunk-time-series-query/get-splunk-time-series-data.d.ts.map +1 -0
- package/lib/queries/splunk-time-series-query/get-splunk-time-series-data.js +98 -0
- package/lib/queries/splunk-time-series-query/get-splunk-time-series-data.js.map +1 -0
- package/lib/queries/splunk-time-series-query/index.d.ts +5 -0
- package/lib/queries/splunk-time-series-query/index.d.ts.map +1 -0
- package/lib/queries/splunk-time-series-query/index.js +18 -0
- package/lib/queries/splunk-time-series-query/index.js.map +1 -0
- package/lib/queries/splunk-time-series-query/splunk-time-series-query-types.d.ts +10 -0
- package/lib/queries/splunk-time-series-query/splunk-time-series-query-types.d.ts.map +1 -0
- package/lib/queries/splunk-time-series-query/splunk-time-series-query-types.js +15 -0
- package/lib/queries/splunk-time-series-query/splunk-time-series-query-types.js.map +1 -0
- package/lib/setup-tests.d.ts +2 -0
- package/lib/setup-tests.d.ts.map +1 -0
- package/lib/setup-tests.js +17 -0
- package/lib/setup-tests.js.map +1 -0
- package/mf-manifest.json +198 -0
- package/mf-stats.json +220 -0
- package/package.json +74 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
function _getRequireWildcardCache(nodeInterop) {
|
|
3
|
+
if (typeof WeakMap !== "function") return null;
|
|
4
|
+
var cacheBabelInterop = new WeakMap();
|
|
5
|
+
var cacheNodeInterop = new WeakMap();
|
|
6
|
+
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
7
|
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
8
|
+
})(nodeInterop);
|
|
9
|
+
}
|
|
10
|
+
function _interop_require_wildcard(obj, nodeInterop) {
|
|
11
|
+
if (!nodeInterop && obj && obj.__esModule) {
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
15
|
+
return {
|
|
16
|
+
default: obj
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
var cache = _getRequireWildcardCache(nodeInterop);
|
|
20
|
+
if (cache && cache.has(obj)) {
|
|
21
|
+
return cache.get(obj);
|
|
22
|
+
}
|
|
23
|
+
var newObj = {
|
|
24
|
+
__proto__: null
|
|
25
|
+
};
|
|
26
|
+
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
27
|
+
for(var key in obj){
|
|
28
|
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
29
|
+
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
30
|
+
if (desc && (desc.get || desc.set)) {
|
|
31
|
+
Object.defineProperty(newObj, key, desc);
|
|
32
|
+
} else {
|
|
33
|
+
newObj[key] = obj[key];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
newObj.default = obj;
|
|
38
|
+
if (cache) {
|
|
39
|
+
cache.set(obj, newObj);
|
|
40
|
+
}
|
|
41
|
+
return newObj;
|
|
42
|
+
}
|
|
43
|
+
// Copyright The Perses Authors
|
|
44
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
45
|
+
// you may not use this file except in compliance with the License.
|
|
46
|
+
// You may obtain a copy of the License at
|
|
47
|
+
//
|
|
48
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
49
|
+
//
|
|
50
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
51
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
52
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
53
|
+
// See the License for the specific language governing permissions and
|
|
54
|
+
// limitations under the License.
|
|
55
|
+
Promise.resolve().then(()=>/*#__PURE__*/ _interop_require_wildcard(require("./bootstrap")));
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "getPluginModule", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return _getPluginModule.getPluginModule;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _getPluginModule = require("./getPluginModule");
|
|
24
|
+
_export_star(require("./model"), exports);
|
|
25
|
+
_export_star(require("./queries"), exports);
|
|
26
|
+
_export_star(require("./datasources"), exports);
|
|
27
|
+
function _export_star(from, to) {
|
|
28
|
+
Object.keys(from).forEach(function(k) {
|
|
29
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
30
|
+
Object.defineProperty(to, k, {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function() {
|
|
33
|
+
return from[k];
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
return from;
|
|
39
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_export_star(require("./splunk-client"), exports);
|
|
18
|
+
_export_star(require("./splunk-client-types"), exports);
|
|
19
|
+
function _export_star(from, to) {
|
|
20
|
+
Object.keys(from).forEach(function(k) {
|
|
21
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
22
|
+
Object.defineProperty(to, k, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return from[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return from;
|
|
31
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
get createJob () {
|
|
25
|
+
return createJob;
|
|
26
|
+
},
|
|
27
|
+
get exportSearch () {
|
|
28
|
+
return exportSearch;
|
|
29
|
+
},
|
|
30
|
+
get getIndexes () {
|
|
31
|
+
return getIndexes;
|
|
32
|
+
},
|
|
33
|
+
get getJobEvents () {
|
|
34
|
+
return getJobEvents;
|
|
35
|
+
},
|
|
36
|
+
get getJobResults () {
|
|
37
|
+
return getJobResults;
|
|
38
|
+
},
|
|
39
|
+
get getJobStatus () {
|
|
40
|
+
return getJobStatus;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const _client = require("@perses-dev/client");
|
|
44
|
+
function buildUrl(path, datasourceUrl) {
|
|
45
|
+
if (datasourceUrl.startsWith('http://') || datasourceUrl.startsWith('https://')) {
|
|
46
|
+
return new URL(path, datasourceUrl);
|
|
47
|
+
}
|
|
48
|
+
let fullPath = datasourceUrl;
|
|
49
|
+
if (datasourceUrl.endsWith('/') && path.startsWith('/')) {
|
|
50
|
+
fullPath = datasourceUrl + path.slice(1);
|
|
51
|
+
} else if (!datasourceUrl.endsWith('/') && !path.startsWith('/')) {
|
|
52
|
+
fullPath = datasourceUrl + '/' + path;
|
|
53
|
+
} else {
|
|
54
|
+
fullPath = datasourceUrl + path;
|
|
55
|
+
}
|
|
56
|
+
return new URL(fullPath, window.location.origin);
|
|
57
|
+
}
|
|
58
|
+
async function createJob(params, options) {
|
|
59
|
+
const url = buildUrl('/services/search/v2/jobs', options.datasourceUrl);
|
|
60
|
+
const formData = new URLSearchParams();
|
|
61
|
+
formData.append('search', params.search);
|
|
62
|
+
if (params.earliest_time) formData.append('earliest_time', params.earliest_time);
|
|
63
|
+
if (params.latest_time) formData.append('latest_time', params.latest_time);
|
|
64
|
+
formData.append('output_mode', params.output_mode || 'json');
|
|
65
|
+
return await (0, _client.fetchJson)(url.toString(), {
|
|
66
|
+
method: 'POST',
|
|
67
|
+
headers: {
|
|
68
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
69
|
+
...options.headers
|
|
70
|
+
},
|
|
71
|
+
body: formData.toString()
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
async function getJobStatus(jobId, options) {
|
|
75
|
+
const url = buildUrl(`/services/search/v2/jobs/${jobId}`, options.datasourceUrl);
|
|
76
|
+
url.searchParams.append('output_mode', 'json');
|
|
77
|
+
return await (0, _client.fetchJson)(url.toString(), {
|
|
78
|
+
method: 'GET',
|
|
79
|
+
headers: {
|
|
80
|
+
'Content-Type': 'application/json',
|
|
81
|
+
...options.headers
|
|
82
|
+
},
|
|
83
|
+
credentials: 'include'
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
async function getJobResults(jobId, params = {}, options) {
|
|
87
|
+
const url = buildUrl(`/services/search/v2/jobs/${jobId}/results`, options.datasourceUrl);
|
|
88
|
+
url.searchParams.append('output_mode', params.output_mode || 'json');
|
|
89
|
+
if (params.count) url.searchParams.append('count', params.count.toString());
|
|
90
|
+
if (params.offset) url.searchParams.append('offset', params.offset.toString());
|
|
91
|
+
return await (0, _client.fetchJson)(url.toString(), {
|
|
92
|
+
method: 'GET',
|
|
93
|
+
headers: {
|
|
94
|
+
'Content-Type': 'application/json',
|
|
95
|
+
...options.headers
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
async function getJobEvents(jobId, params = {}, options) {
|
|
100
|
+
const url = buildUrl(`/services/search/v2/jobs/${jobId}/events`, options.datasourceUrl);
|
|
101
|
+
url.searchParams.append('output_mode', params.output_mode || 'json');
|
|
102
|
+
if (params.count) url.searchParams.append('count', params.count.toString());
|
|
103
|
+
if (params.offset) url.searchParams.append('offset', params.offset.toString());
|
|
104
|
+
return await (0, _client.fetchJson)(url.toString(), {
|
|
105
|
+
method: 'GET',
|
|
106
|
+
headers: {
|
|
107
|
+
'Content-Type': 'application/json',
|
|
108
|
+
...options.headers
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
async function exportSearch(params, options) {
|
|
113
|
+
const url = buildUrl('/services/search/v2/jobs/export', options.datasourceUrl);
|
|
114
|
+
const formData = new URLSearchParams();
|
|
115
|
+
formData.append('search', params.search);
|
|
116
|
+
if (params.earliest_time) formData.append('earliest_time', params.earliest_time);
|
|
117
|
+
if (params.latest_time) formData.append('latest_time', params.latest_time);
|
|
118
|
+
formData.append('output_mode', params.output_mode || 'json');
|
|
119
|
+
const response = await fetch(url.toString(), {
|
|
120
|
+
method: 'POST',
|
|
121
|
+
headers: {
|
|
122
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
123
|
+
...options.headers
|
|
124
|
+
},
|
|
125
|
+
body: formData
|
|
126
|
+
});
|
|
127
|
+
if (!response.ok) {
|
|
128
|
+
const errorText = await response.text();
|
|
129
|
+
throw new Error(`Splunk Export API error: ${response.status} ${response.statusText} ${errorText}`);
|
|
130
|
+
}
|
|
131
|
+
const text = await response.text();
|
|
132
|
+
const lines = text.trim().split('\n');
|
|
133
|
+
const results = lines.filter((line)=>line.trim()).map((line)=>JSON.parse(line).result);
|
|
134
|
+
return {
|
|
135
|
+
results: results,
|
|
136
|
+
preview: false,
|
|
137
|
+
init_offset: 0
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
async function getIndexes(options) {
|
|
141
|
+
const url = buildUrl('/services/data/indexes', options.datasourceUrl);
|
|
142
|
+
url.searchParams.append('output_mode', 'json');
|
|
143
|
+
url.searchParams.append('count', '0');
|
|
144
|
+
return await (0, _client.fetchJson)(url.toString(), {
|
|
145
|
+
method: 'GET',
|
|
146
|
+
headers: {
|
|
147
|
+
'Content-Type': 'application/json',
|
|
148
|
+
...options.headers
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "DEFAULT_DATASOURCE", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return DEFAULT_DATASOURCE;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const DEFAULT_DATASOURCE = {
|
|
24
|
+
kind: 'SplunkDatasource'
|
|
25
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_export_star(require("./splunk-time-series-query"), exports);
|
|
18
|
+
_export_star(require("./splunk-log-query"), exports);
|
|
19
|
+
function _export_star(from, to) {
|
|
20
|
+
Object.keys(from).forEach(function(k) {
|
|
21
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
22
|
+
Object.defineProperty(to, k, {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return from[k];
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return from;
|
|
31
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "SplunkLogQuery", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return SplunkLogQuery;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
+
const _getsplunklogdata = require("./get-splunk-log-data");
|
|
25
|
+
const _SplunkLogQueryEditor = require("./SplunkLogQueryEditor");
|
|
26
|
+
const SplunkLogQuery = {
|
|
27
|
+
getLogData: _getsplunklogdata.getSplunkLogData,
|
|
28
|
+
OptionsEditorComponent: _SplunkLogQueryEditor.SplunkLogQueryEditor,
|
|
29
|
+
createInitialOptions: ()=>({
|
|
30
|
+
query: ''
|
|
31
|
+
}),
|
|
32
|
+
dependsOn: (spec)=>{
|
|
33
|
+
const queryVariables = (0, _pluginsystem.parseVariables)(spec.query);
|
|
34
|
+
const allVariables = [
|
|
35
|
+
...new Set([
|
|
36
|
+
...queryVariables
|
|
37
|
+
])
|
|
38
|
+
];
|
|
39
|
+
return {
|
|
40
|
+
variables: allVariables
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "SplunkLogQueryEditor", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return SplunkLogQueryEditor;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
24
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
25
|
+
const _material = require("@mui/material");
|
|
26
|
+
const _immer = require("immer");
|
|
27
|
+
const DATASOURCE_KIND = 'SplunkDatasource';
|
|
28
|
+
const DEFAULT_DATASOURCE = {
|
|
29
|
+
kind: DATASOURCE_KIND
|
|
30
|
+
};
|
|
31
|
+
function SplunkLogQueryEditor(props) {
|
|
32
|
+
const { onChange, value } = props;
|
|
33
|
+
const { datasource, query } = value;
|
|
34
|
+
const datasourceSelectValue = datasource ?? DEFAULT_DATASOURCE;
|
|
35
|
+
const selectedDatasource = (0, _pluginsystem.useDatasourceSelectValueToSelector)(datasourceSelectValue, DATASOURCE_KIND);
|
|
36
|
+
const handleDatasourceChange = (newDatasourceSelection)=>{
|
|
37
|
+
if (!(0, _pluginsystem.isVariableDatasource)(newDatasourceSelection) && newDatasourceSelection.kind === DATASOURCE_KIND) {
|
|
38
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
39
|
+
draft.datasource = newDatasourceSelection;
|
|
40
|
+
}));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
throw new Error('Got unexpected non SplunkQuery datasource selection');
|
|
44
|
+
};
|
|
45
|
+
const handleQueryChange = (newQuery)=>{
|
|
46
|
+
onChange((0, _immer.produce)(value, (draft)=>{
|
|
47
|
+
draft.query = newQuery;
|
|
48
|
+
}));
|
|
49
|
+
};
|
|
50
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
51
|
+
spacing: 1.5,
|
|
52
|
+
paddingBottom: 1,
|
|
53
|
+
children: [
|
|
54
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
55
|
+
children: [
|
|
56
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
57
|
+
sx: {
|
|
58
|
+
display: 'block',
|
|
59
|
+
marginBottom: '4px',
|
|
60
|
+
fontWeight: 500
|
|
61
|
+
},
|
|
62
|
+
children: "Datasource"
|
|
63
|
+
}),
|
|
64
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_pluginsystem.DatasourceSelect, {
|
|
65
|
+
datasourcePluginKind: DATASOURCE_KIND,
|
|
66
|
+
value: selectedDatasource,
|
|
67
|
+
onChange: handleDatasourceChange,
|
|
68
|
+
label: "Splunk Datasource",
|
|
69
|
+
notched: true
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
}),
|
|
73
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.InputLabel, {
|
|
76
|
+
sx: {
|
|
77
|
+
display: 'block',
|
|
78
|
+
marginBottom: '4px',
|
|
79
|
+
fontWeight: 500
|
|
80
|
+
},
|
|
81
|
+
children: "SPL Query"
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
|
|
84
|
+
fullWidth: true,
|
|
85
|
+
multiline: true,
|
|
86
|
+
rows: 4,
|
|
87
|
+
value: query,
|
|
88
|
+
onChange: (e)=>handleQueryChange(e.target.value),
|
|
89
|
+
placeholder: "search index=main error"
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "getSplunkLogData", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return getSplunkLogData;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _pluginsystem = require("@perses-dev/plugin-system");
|
|
24
|
+
const _constants = require("../constants");
|
|
25
|
+
function convertResultsToLogs(results) {
|
|
26
|
+
const resultsArray = Array.isArray(results) ? results : [
|
|
27
|
+
results
|
|
28
|
+
];
|
|
29
|
+
const entries = resultsArray.map((result)=>({
|
|
30
|
+
timestamp: new Date(result._time).getTime() / 1000,
|
|
31
|
+
line: result._raw || JSON.stringify(result),
|
|
32
|
+
// Convert all other response properties to labels, excluding '_time' and '_raw' as they are used in panel row display
|
|
33
|
+
labels: Object.fromEntries(Object.entries(result).filter(([key])=>key !== '_time' && key !== '_raw'))
|
|
34
|
+
}));
|
|
35
|
+
return {
|
|
36
|
+
entries,
|
|
37
|
+
totalCount: entries.length
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const getSplunkLogData = async (spec, context)=>{
|
|
41
|
+
if (!spec.query) {
|
|
42
|
+
return {
|
|
43
|
+
logs: {
|
|
44
|
+
entries: [],
|
|
45
|
+
totalCount: 0
|
|
46
|
+
},
|
|
47
|
+
timeRange: {
|
|
48
|
+
start: context.timeRange.start,
|
|
49
|
+
end: context.timeRange.end
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const query = (0, _pluginsystem.replaceVariables)(spec.query, context.variableState);
|
|
54
|
+
const client = await context.datasourceStore.getDatasourceClient(spec.datasource ?? _constants.DEFAULT_DATASOURCE);
|
|
55
|
+
const datasourceSpec = await context.datasourceStore.getDatasource(spec.datasource ?? _constants.DEFAULT_DATASOURCE);
|
|
56
|
+
const allowedEndpoints = datasourceSpec.plugin.spec?.proxy?.spec?.allowedEndpoints || [];
|
|
57
|
+
const hasExportEndpoint = allowedEndpoints.some((ep)=>ep.endpointPattern?.includes('/export'));
|
|
58
|
+
//TODO - Ideally this Indexes endpoint to be pushed inside the explorer view.
|
|
59
|
+
const hasIndexesEndpoint = allowedEndpoints.some((ep)=>ep.endpointPattern?.includes('/indexes'));
|
|
60
|
+
const { start, end } = context.timeRange;
|
|
61
|
+
const earliest_time = Math.floor(start.getTime() / 1000).toString();
|
|
62
|
+
const latest_time = Math.floor(end.getTime() / 1000).toString();
|
|
63
|
+
let eventsResponse;
|
|
64
|
+
if (hasExportEndpoint || datasourceSpec.plugin.spec.directUrl) {
|
|
65
|
+
eventsResponse = await client.exportSearch({
|
|
66
|
+
search: query,
|
|
67
|
+
earliest_time: spec.earliest || earliest_time,
|
|
68
|
+
latest_time: spec.latest || latest_time
|
|
69
|
+
});
|
|
70
|
+
} else if (hasIndexesEndpoint || datasourceSpec.plugin.spec.directUrl) {
|
|
71
|
+
//TODO - Ideally this Indexes endpoint to be pushed inside the explorer view.
|
|
72
|
+
const indexesResponse = await client.getIndexes();
|
|
73
|
+
const entries = indexesResponse?.entry ? indexesResponse.entry.map((index)=>({
|
|
74
|
+
// Use current time as timestamp since index response does not include a timestamp.
|
|
75
|
+
timestamp: new Date().getTime() / 1000,
|
|
76
|
+
line: index.name,
|
|
77
|
+
// Convert all other index response properties to labels, excluding 'name' as it is used in panel row display
|
|
78
|
+
labels: Object.fromEntries(Object.entries(index).filter(([key])=>key !== 'name').map(([key, value])=>[
|
|
79
|
+
key,
|
|
80
|
+
typeof value === 'object' ? JSON.stringify(value) : String(value)
|
|
81
|
+
]))
|
|
82
|
+
})) : [];
|
|
83
|
+
return {
|
|
84
|
+
logs: {
|
|
85
|
+
entries,
|
|
86
|
+
totalCount: entries.length
|
|
87
|
+
},
|
|
88
|
+
timeRange: {
|
|
89
|
+
start,
|
|
90
|
+
end
|
|
91
|
+
},
|
|
92
|
+
metadata: {
|
|
93
|
+
executedQueryString: query
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
} else {
|
|
97
|
+
const jobResponse = await client.createJob({
|
|
98
|
+
search: query,
|
|
99
|
+
earliest_time: spec.earliest || earliest_time,
|
|
100
|
+
latest_time: spec.latest || latest_time
|
|
101
|
+
});
|
|
102
|
+
const jobId = jobResponse.sid;
|
|
103
|
+
let jobStatus;
|
|
104
|
+
do {
|
|
105
|
+
await new Promise((resolve)=>setTimeout(resolve, 500));
|
|
106
|
+
jobStatus = await client.getJobStatus(jobId);
|
|
107
|
+
if (!jobStatus || !jobStatus.entry?.[0]?.content) {
|
|
108
|
+
console.warn('Failed to get job status or job status response is malformed', {
|
|
109
|
+
jobStatus
|
|
110
|
+
});
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}while (!jobStatus.entry?.[0]?.content?.isDone)
|
|
114
|
+
eventsResponse = await client.getJobResults(jobId);
|
|
115
|
+
}
|
|
116
|
+
const logs = convertResultsToLogs(eventsResponse.results);
|
|
117
|
+
return {
|
|
118
|
+
logs,
|
|
119
|
+
timeRange: {
|
|
120
|
+
start,
|
|
121
|
+
end
|
|
122
|
+
},
|
|
123
|
+
metadata: {
|
|
124
|
+
executedQueryString: query
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
_export_star(require("./get-splunk-log-data"), exports);
|
|
18
|
+
_export_star(require("./SplunkLogQuery"), exports);
|
|
19
|
+
_export_star(require("./SplunkLogQueryEditor"), exports);
|
|
20
|
+
_export_star(require("./splunk-log-query-types"), exports);
|
|
21
|
+
function _export_star(from, to) {
|
|
22
|
+
Object.keys(from).forEach(function(k) {
|
|
23
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
|
|
24
|
+
Object.defineProperty(to, k, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function() {
|
|
27
|
+
return from[k];
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return from;
|
|
33
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Copyright The Perses Authors
|
|
2
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
3
|
+
// you may not use this file except in compliance with the License.
|
|
4
|
+
// You may obtain a copy of the License at
|
|
5
|
+
//
|
|
6
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
+
//
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
13
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|