spl2dql 0.0.0-stage → 0.1.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 +202 -0
- package/NOTICE +18 -0
- package/README.md +82 -2
- package/bin/spl2dql.js +20 -0
- package/dist/inputs.d.ts +21 -0
- package/dist/inputs.js +130 -0
- package/dist/main.d.ts +41 -0
- package/dist/main.js +650 -0
- package/dist/mapping.d.ts +18 -0
- package/dist/mapping.js +60 -0
- package/dist/report.d.ts +95 -0
- package/dist/report.js +285 -0
- package/dist/safe-fs.d.ts +7 -0
- package/dist/safe-fs.js +81 -0
- package/dist/serve/server.d.ts +47 -0
- package/dist/serve/server.js +195 -0
- package/package.json +64 -3
- package/web/404.html +27 -0
- package/web/THIRD-PARTY-NOTICES.txt +774 -0
- package/web/_headers +26 -0
- package/web/assets/BatchView-CJw9TDhQ.js +1 -0
- package/web/assets/DashboardsView-gW0FEoq7.js +1 -0
- package/web/assets/DropZone-CIbk77sc.js +492 -0
- package/web/assets/MappingView-Co21Vkp_.js +14 -0
- package/web/assets/ReferenceView-S1R-kCt6.js +2 -0
- package/web/assets/atkinson-hyperlegible-mono-latin-ext-wght-normal-CXgNM06D.woff2 +0 -0
- package/web/assets/atkinson-hyperlegible-mono-latin-wght-normal-CoA7y8X5.woff2 +0 -0
- package/web/assets/atkinson-hyperlegible-next-latin-ext-wght-normal-C6vrW8VD.woff2 +0 -0
- package/web/assets/atkinson-hyperlegible-next-latin-wght-normal-BcXVPD7q.woff2 +0 -0
- package/web/assets/dict-9ToLi8Te.js +1 -0
- package/web/assets/index-BO3AM1fZ.js +46 -0
- package/web/assets/index-DPywAY6M.css +2 -0
- package/web/assets/jsx-runtime-Wy9s6hX0.js +1 -0
- package/web/assets/mapping-text-B64_Oh2A.js +106 -0
- package/web/assets/translate.worker-C2M3Sf23.js +656 -0
- package/web/icon-180.png +0 -0
- package/web/icon-192.png +0 -0
- package/web/icon-512.png +0 -0
- package/web/icon.svg +1 -0
- package/web/index.html +63 -0
- package/web/manifest.webmanifest +15 -0
- package/web/robots.txt +2 -0
- package/web/social.png +0 -0
- package/web/sw.js +24 -0
package/web/_headers
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Generated by apps/web/vite.config.ts from the same policy as the page's <meta> tag.
|
|
2
|
+
# Rules apply in order; "! Name" removes a header an earlier rule set.
|
|
3
|
+
/*
|
|
4
|
+
Content-Security-Policy: default-src 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; font-src 'self'; connect-src 'none'; worker-src 'self'; manifest-src 'self'; object-src 'none'; base-uri 'none'; form-action 'none'; require-trusted-types-for 'script'; trusted-types spl2dql; frame-ancestors 'none'
|
|
5
|
+
X-Content-Type-Options: nosniff
|
|
6
|
+
X-Frame-Options: DENY
|
|
7
|
+
Referrer-Policy: no-referrer
|
|
8
|
+
Cross-Origin-Opener-Policy: same-origin
|
|
9
|
+
Cross-Origin-Resource-Policy: same-origin
|
|
10
|
+
Permissions-Policy: camera=(), microphone=(), geolocation=(), payment=(), usb=()
|
|
11
|
+
Cache-Control: no-cache
|
|
12
|
+
|
|
13
|
+
# File names under /assets carry a content hash: they never change.
|
|
14
|
+
/assets/*
|
|
15
|
+
! Cache-Control
|
|
16
|
+
Cache-Control: public, max-age=31536000, immutable
|
|
17
|
+
|
|
18
|
+
# The service worker fetches the app's own files to start offline; the page itself fetches nothing.
|
|
19
|
+
/sw.js
|
|
20
|
+
! Content-Security-Policy
|
|
21
|
+
Content-Security-Policy: default-src 'none'; connect-src 'self'; frame-ancestors 'none'
|
|
22
|
+
|
|
23
|
+
# The link-preview picture is the one file other sites are meant to show.
|
|
24
|
+
/social.png
|
|
25
|
+
! Cross-Origin-Resource-Policy
|
|
26
|
+
Cross-Origin-Resource-Policy: cross-origin
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,a as t,c as n,f as r,i,m as a,r as o,t as s}from"./index-BO3AM1fZ.js";import{a as c,n as l,t as u}from"./DropZone-CIbk77sc.js";import{a as d,n as f,t as p}from"./jsx-runtime-Wy9s6hX0.js";var m=d(f(),1),h=p();function g(e){let t=[];return e.disabled&&t.push(`Switched off in Splunk`),(e.earliest!==void 0||e.latest!==void 0)&&t.push(`${e.earliest??`…`} to ${e.latest??`now`}`),e.schedule!==void 0&&t.push(`runs ${e.schedule}`),t.join(` · `)}var _={high:`mark-exact`,review:`mark-check`,low:`mark-untranslated`,none:`mark-untranslated`},v={high:`●`,review:`▲`,low:`■`,none:`■`},y=[`none`,`low`,`review`,`high`];function b(){let d=a(e=>e.batch),f=a(e=>e.setSpl),p=a(e=>e.setView),[b,x]=(0,m.useState)(`all`),S=(0,m.useMemo)(()=>d.filter(e=>b===`all`||e.result.confidence===b).sort((e,t)=>y.indexOf(e.result.confidence)-y.indexOf(t.result.confidence)||(e.name<t.name?-1:1)),[d,b]),C=()=>{let t=new Set([`report.json`]),n={},r=new TextEncoder,i=d.map(i=>{let a=`${e(i.name,t)}.dql`;return n[a]=r.encode(`${i.result.dql}\n`),{name:i.name,origin:i.origin,file:a,confidence:i.result.confidence,...i.earliest===void 0?{}:{earliest:i.earliest},...i.latest===void 0?{}:{latest:i.latest},...i.schedule===void 0?{}:{schedule:i.schedule},...i.disabled?{disabled:!0}:{},spl:i.spl,dql:i.result.dql,notes:i.result.diagnostics}});n[`report.json`]=r.encode(`${JSON.stringify({searches:i},null,2)}\n`);let a=new Blob([s(n)],{type:`application/zip`}),o=document.createElement(`a`);o.href=URL.createObjectURL(a),o.download=`spl2dql-results.zip`,o.click(),setTimeout(()=>URL.revokeObjectURL(o.href),1e3)},w=(0,m.useMemo)(()=>{let e={high:0,review:0,low:0,none:0};for(let t of d)e[t.result.confidence]++;return e},[d]);return(0,h.jsx)(`div`,{className:`h-full overflow-auto`,children:(0,h.jsxs)(`div`,{className:`mx-auto max-w-5xl px-4 py-6`,children:[(0,h.jsx)(u,{title:`Drop saved searches here`,compact:d.length>0,sample:d.length===0,children:(0,h.jsx)(`p`,{children:`.spl and .txt files (one search each), savedsearches.conf with each search's saved time range, CSV files with a "search" column — or a whole Splunk app folder. macros.conf, props.conf, eventtypes.conf and tags.conf in the same drop are read into the mapping first. Files are read in this browser and never uploaded.`})}),(0,h.jsx)(l,{here:`batch`}),d.length>0&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-center gap-3`,children:[(0,h.jsxs)(`p`,{className:`text-sm`,children:[d.length,` searches: `,w.high,` exact, `,w.review,` need review, `,w.low,` incomplete, `,w.none,` not translated`]}),(0,h.jsxs)(`label`,{className:`ml-auto flex items-center gap-2 text-sm`,children:[`Show`,(0,h.jsxs)(`select`,{className:`field`,value:b,onChange:e=>x(e.target.value),children:[(0,h.jsx)(`option`,{value:`all`,children:`All`}),y.map(e=>(0,h.jsx)(`option`,{value:e,children:n[e]},e))]})]}),(0,h.jsxs)(`button`,{type:`button`,className:`control primary`,onClick:C,children:[(0,h.jsx)(c,{size:16,"aria-hidden":!0}),`Download results`]})]}),(0,h.jsxs)(`table`,{className:`mt-3 w-full border-collapse bg-surface text-sm`,"data-testid":`batch-table`,children:[(0,h.jsx)(`thead`,{children:(0,h.jsxs)(`tr`,{className:`text-left`,children:[(0,h.jsx)(`th`,{className:`border-b border-line px-3 py-2`,children:`Search`}),(0,h.jsx)(`th`,{className:`border-b border-line px-3 py-2`,children:`Confidence`}),(0,h.jsx)(`th`,{className:`hidden border-b border-line px-3 py-2 min-[600px]:table-cell`,children:`Notes`}),(0,h.jsx)(`th`,{className:`border-b border-line px-3 py-2`,children:(0,h.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,h.jsx)(`tbody`,{children:t(S,o.batch).map(e=>(0,h.jsxs)(`tr`,{children:[(0,h.jsxs)(`td`,{className:`border-b border-line px-3 py-2 [overflow-wrap:anywhere]`,children:[e.name,(0,h.jsx)(`span`,{className:`block text-xs text-muted`,children:e.origin}),g(e)!==``&&(0,h.jsx)(`span`,{className:`block text-xs text-muted`,children:g(e)})]}),(0,h.jsxs)(`td`,{className:`border-b border-line px-3 py-2 min-[600px]:whitespace-nowrap`,children:[(0,h.jsxs)(`span`,{className:_[e.result.confidence],"aria-hidden":`true`,children:[v[e.result.confidence],` `]}),n[e.result.confidence]]}),(0,h.jsx)(`td`,{className:`hidden border-b border-line px-3 py-2 min-[600px]:table-cell`,children:r(e.result.diagnostics)}),(0,h.jsx)(`td`,{className:`border-b border-line px-3 py-2 text-right`,children:(0,h.jsx)(`button`,{type:`button`,className:`control`,onClick:()=>{f(e.spl),p(`translate`)},children:`Open`})})]},e.origin))})]}),(0,h.jsx)(i,{total:S.length,limit:o.batch,noun:S.length===1?`search`:`searches`,download:!0,className:`mt-3`})]})]})})}export{b as BatchView};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,a as t,d as n,i as r,l as i,m as a,o,p as s,r as c,s as l,t as u,u as d}from"./index-BO3AM1fZ.js";import{a as f,n as p,t as m}from"./DropZone-CIbk77sc.js";import{a as h,n as g,t as _}from"./jsx-runtime-Wy9s6hX0.js";var v={name:`chart-area`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z`,key:`q0gr47`}]],aliases:[`area-chart`]};v.node;var y=l(v),b={name:`chart-bar`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M7 16h8`,key:`srdodz`}],[`path`,{d:`M7 11h12`,key:`127s9w`}],[`path`,{d:`M7 6h3`,key:`w9rmul`}]],aliases:[`bar-chart-horizontal`]};b.node;var x=l(b),S={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};S.node;var C=l(S),w={name:`chart-line`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]],aliases:[`line-chart`]};w.node;var T=l(w),E={name:`chart-pie`,size:24,node:[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]],aliases:[`pie-chart`]};E.node;var D=l(E),O={name:`chart-scatter`,size:24,node:[[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}],[`circle`,{cx:`18.5`,cy:`5.5`,r:`.5`,fill:`currentColor`,key:`lysivs`}],[`circle`,{cx:`11.5`,cy:`11.5`,r:`.5`,fill:`currentColor`,key:`byv1b8`}],[`circle`,{cx:`7.5`,cy:`16.5`,r:`.5`,fill:`currentColor`,key:`nkw3mc`}],[`circle`,{cx:`17.5`,cy:`14.5`,r:`.5`,fill:`currentColor`,key:`1gjh6j`}],[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}]],aliases:[`scatter-chart`]};O.node;var k=l(O),A={name:`file-text`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]};A.node;var j=l(A),M={name:`gauge`,size:24,node:[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]};M.node;var N=l(M),P={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};P.node;var F=l(P),I={name:`table-2`,size:24,node:[[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]};I.node;var L=l(I),R={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};R.node;var z=l(R),B=h(g(),1),V=_(),H={lineChart:T,areaChart:y,barChart:C,categoricalBarChart:x,pieChart:D,scatterplot:k,gauge:N,singleValue:F,table:L};function U(e){return e.outcome===`manual`?z:e.outcome===`text`?j:H[e.visualization??``]??L}function W(e,t,n){let r=document.createElement(`a`);r.href=URL.createObjectURL(new Blob([t],{type:n})),r.download=e,r.click(),setTimeout(()=>URL.revokeObjectURL(r.href),1e3)}function G(t,n){return`${e(t.conversion.title,n)}.json`}function K(){let e=a(e=>e.dashboards),[n,i]=(0,B.useState)(0),[o,s]=(0,B.useState)(),l=e[Math.min(n,e.length-1)];return(0,B.useEffect)(()=>{i(0)},[e]),(0,B.useEffect)(()=>{let e=l?.conversion.tiles??[];s((e.find(e=>e.outcome===`manual`)??e.find(e=>e.outcome===`live`)??e[0])?.id)},[l]),(0,V.jsx)(`div`,{className:`h-full overflow-auto`,children:(0,V.jsxs)(`div`,{className:`mx-auto max-w-6xl px-4 py-6`,children:[(0,V.jsxs)(m,{title:`Drop Splunk dashboards here`,compact:e.length>0,sample:e.length===0,children:[(0,V.jsx)(`p`,{children:`Simple XML and Dashboard Studio files, or a whole Splunk app folder. A panel becomes a live tile only when its search translated completely; otherwise the tile keeps the Splunk search and says what is missing. Inputs become dashboard variables.`}),e.length===0&&(0,V.jsx)(`p`,{className:`mt-2`,children:`Add savedsearches.conf and macros.conf from the same app so panels that use them resolve. Files are read in this browser and never uploaded.`})]}),(0,V.jsx)(p,{here:`dashboards`}),l&&(0,V.jsxs)(`div`,{className:`mt-6 grid gap-6 min-[900px]:grid-cols-[240px_minmax(0,1fr)]`,children:[(0,V.jsxs)(`nav`,{"aria-label":`Converted dashboards`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsxs)(`h2`,{className:`whitespace-nowrap text-sm font-semibold`,children:[e.length,` dashboard`,e.length===1?``:`s`]}),e.length>1&&(0,V.jsxs)(`button`,{type:`button`,className:`control ml-auto`,onClick:()=>{let t=new Set,n={},r=new TextEncoder;for(let i of e)n[G(i,t)]=r.encode(`${JSON.stringify(i.conversion.dashboard,null,2)}\n`);W(`spl2dql-dashboards.zip`,u(n),`application/zip`)},children:[(0,V.jsx)(f,{size:16,"aria-hidden":!0}),`Download all`]})]}),(0,V.jsx)(`ul`,{className:`mt-2 flex gap-1 overflow-x-auto min-[900px]:flex-col min-[900px]:overflow-visible`,"data-testid":`dashboard-list`,children:t(e,c.dashboards).map((e,t)=>{let n=e.conversion.counts;return(0,V.jsx)(`li`,{className:`shrink-0`,children:(0,V.jsxs)(`button`,{type:`button`,className:`w-full border px-3 py-2 text-left text-sm ${e===l?`border-exact bg-surface`:`border-transparent hover:border-line`}`,"aria-current":e===l?`true`:void 0,onClick:()=>i(t),children:[(0,V.jsx)(`span`,{className:`block font-semibold`,children:e.conversion.title}),(0,V.jsxs)(`span`,{className:`block text-xs text-muted`,children:[(0,V.jsx)(`span`,{className:`mark-exact`,"aria-hidden":`true`,children:`●`}),` `,n.live,` converted`,n.manual>0&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`span`,{className:`mark-untranslated`,"aria-hidden":`true`,children:`■`}),` `,n.manual,` manual`]})]})]})},e.origin)})}),(0,V.jsx)(r,{total:e.length,limit:c.dashboards,noun:`dashboards`,download:!0,className:`mt-2`})]}),(0,V.jsx)(q,{row:l,tileId:o,onTile:s})]})]})})}function q(e){let{conversion:a}=e.row,o=a.counts,l=a.tiles.find(t=>t.id===e.tileId),u=a.dashboard.content.layouts,p=G(e.row,new Set);return(0,V.jsxs)(`section`,{"aria-label":a.title,className:`min-w-0`,"data-testid":`dashboard-detail`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`h2`,{className:`text-lg font-semibold`,children:a.title}),(0,V.jsxs)(`p`,{className:`text-sm`,"data-testid":`dashboard-counts`,children:[o.live,` converted · `,o.manual,` need manual work · `,o.text,` text · `,a.variables.length,` variable`,a.variables.length===1?``:`s`]})]}),(0,V.jsxs)(`button`,{type:`button`,className:`control primary ml-auto`,onClick:()=>W(p,`${JSON.stringify(a.dashboard,null,2)}\n`,`application/json`),children:[(0,V.jsx)(f,{size:16,"aria-hidden":!0}),`Download dashboard`]})]}),(0,V.jsxs)(`p`,{className:`mt-1 text-xs text-muted`,children:[`Import `,(0,V.jsx)(`span`,{className:`font-code`,children:p}),` in the Dynatrace Dashboards app, or run `,(0,V.jsxs)(`span`,{className:`font-code`,children:[`dtctl apply -f `,p]})]}),(0,V.jsx)(`ul`,{className:`tile-grid mt-4`,"aria-label":`Tiles, laid out as in the converted dashboard`,"data-testid":`tile-grid`,children:t(a.tiles,c.tiles).map(t=>{let r=u[t.id];if(!r)return null;let a=s(t),o=U(t);return(0,V.jsx)(`li`,{style:{gridColumn:`${r.x+1} / span ${r.w}`,gridRow:`${r.y+1} / span ${r.h}`},className:`min-h-0 min-w-0`,children:(0,V.jsxs)(`button`,{type:`button`,className:`tile ${t.id===e.tileId?`selected`:``}`,"aria-pressed":t.id===e.tileId,onClick:()=>e.onTile(t.id),children:[(0,V.jsxs)(`span`,{className:`block truncate font-semibold`,children:[(0,V.jsxs)(`span`,{className:i[a],"aria-hidden":`true`,children:[d[a],` `]}),t.title||`Untitled`]}),r.h>1?(0,V.jsxs)(`span`,{className:`block truncate text-muted`,children:[n[a],t.visualization?` · ${t.visualization}`:``]}):(0,V.jsx)(`span`,{className:`sr-only`,children:n[a]}),r.h>=4&&(0,V.jsx)(`span`,{className:`tile-figure`,"aria-hidden":`true`,children:(0,V.jsx)(o,{size:28,strokeWidth:1.5})})]})},t.id)})}),(0,V.jsx)(r,{total:a.tiles.length,limit:c.tiles,noun:`tiles`,download:!0,className:`mt-2`}),l&&(0,V.jsx)(X,{tile:l}),a.variables.length>0&&(0,V.jsxs)(`div`,{className:`mt-6`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Variables`}),(0,V.jsx)(`ul`,{className:`mt-2 border-t border-line bg-surface text-sm`,"data-testid":`variables`,children:t(a.variables,c.list).map(e=>(0,V.jsxs)(`li`,{className:`border-b border-line px-3 py-2`,children:[(0,V.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,V.jsxs)(`span`,{className:`font-code font-semibold`,children:[`$`,e.key]}),(0,V.jsx)(`span`,{children:J[e.type]}),(0,V.jsxs)(`span`,{className:`text-muted`,children:[`replaces `,(0,V.jsxs)(`span`,{className:`font-code`,children:[`$`,e.token,`$`]})]})]}),e.notes.length>0&&(0,V.jsx)(`div`,{className:`mt-1`,children:(0,V.jsx)(Y,{notes:e.notes})})]},e.key))}),(0,V.jsx)(r,{total:a.variables.length,limit:c.list,noun:`variables`,download:!0,className:`mt-2`})]}),a.notes.length>0&&(0,V.jsxs)(`div`,{className:`mt-6`,children:[(0,V.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Left out of this dashboard`}),(0,V.jsx)(`div`,{className:`mt-1 text-sm`,children:(0,V.jsx)(Y,{notes:a.notes})})]})]})}var J={query:`Filled by a query`,csv:`Fixed list`,text:`Free text`};function Y(e){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`ul`,{className:`space-y-1`,children:t(e.notes,c.list).map(t=>(0,V.jsxs)(`li`,{className:`flex gap-2`,children:[(0,V.jsx)(`span`,{className:e.blocking?`mark-untranslated`:`mark-check`,"aria-hidden":`true`,children:e.blocking?`■`:`▲`}),(0,V.jsx)(`span`,{children:t})]},t))}),(0,V.jsx)(r,{total:e.notes.length,limit:c.list,noun:`notes`,className:`mt-1`})]})}function X(e){let{tile:t}=e,r=a(e=>e.setSpl),c=a(e=>e.setView),[l,u]=(0,B.useState)(!1),f=s(t),p=t.result?.dql??``,m=async()=>{try{await navigator.clipboard.writeText(p),u(!0),setTimeout(()=>u(!1),1500)}catch{}};return(0,V.jsxs)(`div`,{className:`mt-4 border border-line bg-surface p-4`,"data-testid":`tile-detail`,children:[(0,V.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`h3`,{className:`font-semibold`,children:t.title||`Untitled`}),(0,V.jsxs)(`span`,{className:`text-sm`,children:[(0,V.jsxs)(`span`,{className:i[f],"aria-hidden":`true`,children:[d[f],` `]}),n[f],t.visualization?` · shown as ${t.visualization}`:``]}),t.spl!==void 0&&(0,V.jsxs)(`div`,{className:`ml-auto flex flex-wrap gap-2`,children:[t.outcome===`live`&&(0,V.jsxs)(`button`,{type:`button`,className:`control`,onClick:()=>void m(),children:[(0,V.jsx)(o,{size:16,"aria-hidden":!0}),l?`Copied`:`Copy DQL`]}),(0,V.jsx)(`button`,{type:`button`,className:`control`,onClick:()=>{r(t.spl??``),c(`translate`)},children:`Open in Translate`})]})]}),t.spl!==void 0&&(0,V.jsxs)(`div`,{className:`mt-3 grid gap-4 min-[760px]:grid-cols-2`,children:[(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`h4`,{className:`text-xs font-semibold text-muted`,children:`Splunk SPL`}),(0,V.jsx)(`pre`,{className:`code-block`,children:t.spl})]}),(0,V.jsxs)(`div`,{className:`min-w-0`,children:[(0,V.jsx)(`h4`,{className:`text-xs font-semibold text-muted`,children:t.outcome===`live`?`Dynatrace DQL`:`DQL so far`}),(0,V.jsx)(`pre`,{className:`code-block`,children:p===``?`Nothing could be translated.`:p})]})]}),t.notes.length>0&&(0,V.jsxs)(`div`,{className:`mt-3 text-sm`,children:[(0,V.jsx)(`h4`,{className:`text-xs font-semibold text-muted`,children:t.outcome===`manual`?`What is missing`:`To check`}),(0,V.jsx)(`div`,{className:`mt-1`,children:(0,V.jsx)(Y,{notes:t.notes,blocking:t.outcome===`manual`})})]}),t.outcome===`text`&&t.notes.length===0&&(0,V.jsx)(`p`,{className:`mt-2 text-sm text-muted`,children:`A text panel, carried over as a Markdown tile.`})]})}export{K as DashboardsView};
|
|
@@ -0,0 +1,492 @@
|
|
|
1
|
+
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{S as r,_ as i,a,b as o,g as s,h as c,i as l,m as u,r as d,s as f,v as p,y as m}from"./index-BO3AM1fZ.js";import{n as h}from"./mapping-text-B64_Oh2A.js";var g={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};g.node;var _=f(g),v={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};v.node;var y=f(v),b={name:`upload`,size:24,node:[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]};b.node;var x=f(b),S=e(t(),1),C=2e3;function w(e){return{path:e.webkitRelativePath||e.name,size:e.size,blob:e}}function T(e){if(e.length>2e3)throw new r(`Choose at most ${C} files at once.`);let t=0;for(let n of e)t+=n.size;if(t>104857600)throw new r(`These files add up to more than 100 MB. Choose fewer files at once.`)}var E=5e7;function D(){let e=globalThis.__spl2dqlKeepLimit;return typeof e==`number`&&e>=0?Math.min(e,E):E}async function O(e,t={}){T(e);let n;try{n=await m(e)}catch(e){throw e instanceof s?new r(`These files took too long to read and were stopped. Choose fewer files at once.`):e}let a={searches:n.searches.length,dashboards:0,added:0,skipped:[],problems:[]};if(n.searches.length===0&&n.dashboards.length===0&&n.configs.length===0)throw new r(`None of these files is a search, a Splunk dashboard or a Splunk configuration file.`);let l=t.sample===!0&&c(u.getState().mappingText);if(a.example=l,n.configs.length>0&&!l){let e=u.getState(),t=await p(n.configs,{own:e.mappingText});if(t){a.skipped=t.skipped.map(e=>({name:`${e.section}: ${e.name}`,reason:e.reason}));let n=h(e.mappingText,t.sections);n?(a.added=n.added,n.added>0&&e.setMappingText(n.text)):a.problems.push(`The mapping file has a YAML problem, so nothing was added to it. Fix it on the Mapping page and choose the files again.`)}}let{mappingText:d,earliest:f}=u.getState(),g=l?{example:!0}:{own:d},_={mapping:g,timeRange:f?{earliest:f}:{}},v=D(),y=!1,b={searches:[],dashboards:[]};if(n.searches.length>0)try{let{kept:e,spent:t}=await o(n.searches.map(e=>({spl:e.spl,...e.earliest===void 0?{}:{earliest:e.earliest},...e.latest===void 0?{}:{latest:e.latest}})),{..._,budget:v});v-=t;let r=e.map((e,t)=>({...n.searches[t],result:e}));for(let t of n.searches.slice(e.length))b.searches.push(t.name);e.length<n.searches.length&&(y=!0),a.searches=r.length,u.getState().setBatch(r)}catch(e){if(!(e instanceof s))throw e;a.searches=0,a.problems.push(`The searches took too long to translate and were stopped. Choose fewer files at once.`)}if(n.dashboards.length>0){let e=new Map;for(let t of[...u.getState().batch,...n.searches])e.set(t.name,{spl:t.spl,...t.earliest===void 0?{}:{earliest:t.earliest},...t.latest===void 0?{}:{latest:t.latest}});let t=[];for(let r of n.dashboards){if(y){b.dashboards.push(r.name);continue}let n=await i(r,{mapping:g,savedSearches:[...e],budget:v});n.ok?(t.push({origin:n.name,conversion:n.conversion}),v-=n.cost):n.overBudget?(b.dashboards.push(r.name),y=!0):a.problems.push(n.error)}a.dashboards=t.length,t.length>0&&u.getState().setDashboards(t)}if((b.searches.length>0||b.dashboards.length>0)&&(a.overBudget=b),t.sample){let e=n.searches.map(e=>e.spl);for(let t of u.getState().dashboards)for(let n of t.conversion.tiles)n.spl&&e.push(n.spl);u.getState().addExamples(e)}return n.ignored.length>0&&a.problems.push(`${n.ignored.length} file(s) were not read: ${n.ignored.slice(0,3).join(`, `)}${n.ignored.length>3?` …`:``}`),u.getState().setIngestNote(a),a}var k=`<dashboard version="2" theme="light">
|
|
2
|
+
<label>Security posture</label>
|
|
3
|
+
<description>Failed sign-ins and blocked traffic.</description>
|
|
4
|
+
<definition><![CDATA[
|
|
5
|
+
{
|
|
6
|
+
"title": "Security posture",
|
|
7
|
+
"description": "Failed sign-ins and blocked traffic.",
|
|
8
|
+
"visualizations": {
|
|
9
|
+
"viz_intro": {
|
|
10
|
+
"type": "splunk.markdown",
|
|
11
|
+
"options": {
|
|
12
|
+
"markdown": "## Authentication\\nFailed sign-ins by user and source, from the Authentication data model."
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"viz_total": {
|
|
16
|
+
"type": "splunk.singlevalue",
|
|
17
|
+
"title": "Failed sign-ins",
|
|
18
|
+
"dataSources": {
|
|
19
|
+
"primary": "ds_total"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"viz_trend": {
|
|
23
|
+
"type": "splunk.area",
|
|
24
|
+
"title": "Failures over time",
|
|
25
|
+
"dataSources": {
|
|
26
|
+
"primary": "ds_trend"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"viz_sources": {
|
|
30
|
+
"type": "splunk.table",
|
|
31
|
+
"title": "Top sources",
|
|
32
|
+
"dataSources": {
|
|
33
|
+
"primary": "ds_sources"
|
|
34
|
+
},
|
|
35
|
+
"eventHandlers": [
|
|
36
|
+
{
|
|
37
|
+
"type": "drilldown.setToken",
|
|
38
|
+
"options": {
|
|
39
|
+
"tokens": [
|
|
40
|
+
{
|
|
41
|
+
"token": "src",
|
|
42
|
+
"key": "row.src.value"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
49
|
+
"viz_actions": {
|
|
50
|
+
"type": "splunk.pie",
|
|
51
|
+
"title": "Firewall actions",
|
|
52
|
+
"dataSources": {
|
|
53
|
+
"primary": "ds_actions"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"viz_logo": {
|
|
57
|
+
"type": "splunk.image",
|
|
58
|
+
"options": {
|
|
59
|
+
"src": "/static/app/sample/logo.png"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"viz_flows": {
|
|
63
|
+
"type": "splunk.sankey",
|
|
64
|
+
"title": "Zone to zone",
|
|
65
|
+
"dataSources": {
|
|
66
|
+
"primary": "ds_flows"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"dataSources": {
|
|
71
|
+
"ds_base": {
|
|
72
|
+
"type": "ds.search",
|
|
73
|
+
"name": "Authentication failures",
|
|
74
|
+
"options": {
|
|
75
|
+
"query": "| tstats count from datamodel=Authentication where Authentication.action=failure Authentication.user=$user$ by _time span=1h Authentication.user Authentication.src"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"ds_total": {
|
|
79
|
+
"type": "ds.chain",
|
|
80
|
+
"options": {
|
|
81
|
+
"extend": "ds_base",
|
|
82
|
+
"query": "| stats sum(count) as failures"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"ds_trend": {
|
|
86
|
+
"type": "ds.chain",
|
|
87
|
+
"options": {
|
|
88
|
+
"extend": "ds_base",
|
|
89
|
+
"query": "| timechart span=1h sum(count) as failures"
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
"ds_sources": {
|
|
93
|
+
"type": "ds.chain",
|
|
94
|
+
"options": {
|
|
95
|
+
"extend": "ds_base",
|
|
96
|
+
"query": "| stats sum(count) as failures by Authentication.src | sort - failures | head $top_n$"
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
"ds_actions": {
|
|
100
|
+
"type": "ds.search",
|
|
101
|
+
"options": {
|
|
102
|
+
"query": "index=firewall action=* | stats count by action",
|
|
103
|
+
"queryParameters": {
|
|
104
|
+
"earliest": "-60m@m",
|
|
105
|
+
"latest": "now"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"ds_flows": {
|
|
110
|
+
"type": "ds.search",
|
|
111
|
+
"options": {
|
|
112
|
+
"query": "index=firewall action=blocked | stats count by src_zone dest_zone"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"ds_users": {
|
|
116
|
+
"type": "ds.search",
|
|
117
|
+
"options": {
|
|
118
|
+
"query": "| tstats count from datamodel=Authentication by Authentication.user | rename Authentication.user as value | fields value"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"defaults": {
|
|
123
|
+
"dataSources": {
|
|
124
|
+
"ds.search": {
|
|
125
|
+
"options": {
|
|
126
|
+
"queryParameters": {
|
|
127
|
+
"earliest": "$global_time.earliest$",
|
|
128
|
+
"latest": "$global_time.latest$"
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"inputs": {
|
|
135
|
+
"input_time": {
|
|
136
|
+
"type": "input.timerange",
|
|
137
|
+
"title": "Time range",
|
|
138
|
+
"options": {
|
|
139
|
+
"token": "global_time",
|
|
140
|
+
"defaultValue": "-24h@h,now"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"input_user": {
|
|
144
|
+
"type": "input.dropdown",
|
|
145
|
+
"title": "User",
|
|
146
|
+
"options": {
|
|
147
|
+
"token": "user",
|
|
148
|
+
"items": ">frame(label, value) | prepend(formattedStatics) | objects()",
|
|
149
|
+
"defaultValue": "*"
|
|
150
|
+
},
|
|
151
|
+
"dataSources": {
|
|
152
|
+
"primary": "ds_users"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"input_top": {
|
|
156
|
+
"type": "input.number",
|
|
157
|
+
"title": "Rows",
|
|
158
|
+
"options": {
|
|
159
|
+
"token": "top_n",
|
|
160
|
+
"defaultValue": "10"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"layout": {
|
|
165
|
+
"type": "absolute",
|
|
166
|
+
"options": {
|
|
167
|
+
"width": 1440,
|
|
168
|
+
"height": 900
|
|
169
|
+
},
|
|
170
|
+
"structure": [
|
|
171
|
+
{
|
|
172
|
+
"item": "viz_logo",
|
|
173
|
+
"type": "block",
|
|
174
|
+
"position": {
|
|
175
|
+
"x": 1300,
|
|
176
|
+
"y": 10,
|
|
177
|
+
"w": 120,
|
|
178
|
+
"h": 60
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"item": "viz_intro",
|
|
183
|
+
"type": "block",
|
|
184
|
+
"position": {
|
|
185
|
+
"x": 20,
|
|
186
|
+
"y": 10,
|
|
187
|
+
"w": 1000,
|
|
188
|
+
"h": 90
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"item": "viz_total",
|
|
193
|
+
"type": "block",
|
|
194
|
+
"position": {
|
|
195
|
+
"x": 20,
|
|
196
|
+
"y": 110,
|
|
197
|
+
"w": 340,
|
|
198
|
+
"h": 300
|
|
199
|
+
}
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"item": "viz_trend",
|
|
203
|
+
"type": "block",
|
|
204
|
+
"position": {
|
|
205
|
+
"x": 380,
|
|
206
|
+
"y": 110,
|
|
207
|
+
"w": 1040,
|
|
208
|
+
"h": 300
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"item": "viz_sources",
|
|
213
|
+
"type": "block",
|
|
214
|
+
"position": {
|
|
215
|
+
"x": 20,
|
|
216
|
+
"y": 430,
|
|
217
|
+
"w": 700,
|
|
218
|
+
"h": 400
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"item": "viz_actions",
|
|
223
|
+
"type": "block",
|
|
224
|
+
"position": {
|
|
225
|
+
"x": 740,
|
|
226
|
+
"y": 430,
|
|
227
|
+
"w": 340,
|
|
228
|
+
"h": 400
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"item": "viz_flows",
|
|
233
|
+
"type": "block",
|
|
234
|
+
"position": {
|
|
235
|
+
"x": 1100,
|
|
236
|
+
"y": 430,
|
|
237
|
+
"w": 320,
|
|
238
|
+
"h": 400
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
],
|
|
242
|
+
"globalInputs": [
|
|
243
|
+
"input_time",
|
|
244
|
+
"input_user",
|
|
245
|
+
"input_top"
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
]]></definition>
|
|
250
|
+
</dashboard>
|
|
251
|
+
`,A=`<form version="1.1">
|
|
252
|
+
<label>Web overview</label>
|
|
253
|
+
<description>Traffic, errors and slow pages for the web tier.</description>
|
|
254
|
+
<search id="base">
|
|
255
|
+
<query>\`web_index\` sourcetype=access_combined host=$host_tok$ | fields _time host status uri bytes</query>
|
|
256
|
+
<earliest>$time.earliest$</earliest>
|
|
257
|
+
<latest>$time.latest$</latest>
|
|
258
|
+
</search>
|
|
259
|
+
<fieldset submitButton="false">
|
|
260
|
+
<input type="time" token="time">
|
|
261
|
+
<label>Time</label>
|
|
262
|
+
<default><earliest>-24h@h</earliest><latest>now</latest></default>
|
|
263
|
+
</input>
|
|
264
|
+
<input type="dropdown" token="host_tok" searchWhenChanged="true">
|
|
265
|
+
<label>Host</label>
|
|
266
|
+
<choice value="*">All</choice>
|
|
267
|
+
<fieldForLabel>host</fieldForLabel>
|
|
268
|
+
<fieldForValue>host</fieldForValue>
|
|
269
|
+
<search><query>\`web_index\` | stats count by host</query><earliest>-24h</earliest></search>
|
|
270
|
+
<default>*</default>
|
|
271
|
+
</input>
|
|
272
|
+
<input type="multiselect" token="status_tok">
|
|
273
|
+
<label>Status</label>
|
|
274
|
+
<choice value="500">500</choice>
|
|
275
|
+
<choice value="502">502</choice>
|
|
276
|
+
<choice value="503">503</choice>
|
|
277
|
+
<valuePrefix>status="</valuePrefix>
|
|
278
|
+
<valueSuffix>"</valueSuffix>
|
|
279
|
+
<delimiter> OR </delimiter>
|
|
280
|
+
<default>500,502,503</default>
|
|
281
|
+
</input>
|
|
282
|
+
<input type="text" token="uri_tok">
|
|
283
|
+
<label>URI contains</label>
|
|
284
|
+
<default>*</default>
|
|
285
|
+
</input>
|
|
286
|
+
</fieldset>
|
|
287
|
+
<row>
|
|
288
|
+
<panel>
|
|
289
|
+
<single>
|
|
290
|
+
<title>Requests</title>
|
|
291
|
+
<search base="base"><query>stats count</query></search>
|
|
292
|
+
</single>
|
|
293
|
+
</panel>
|
|
294
|
+
<panel>
|
|
295
|
+
<single>
|
|
296
|
+
<title>Error rate %</title>
|
|
297
|
+
<search base="base"><query>stats count as total, count(eval(status>=500)) as errors | eval pct=round(errors/total*100, 2) | fields pct</query></search>
|
|
298
|
+
</single>
|
|
299
|
+
</panel>
|
|
300
|
+
<panel>
|
|
301
|
+
<chart>
|
|
302
|
+
<title>Requests over time</title>
|
|
303
|
+
<search base="base"><query>timechart span=5m count by status</query></search>
|
|
304
|
+
<option name="charting.chart">line</option>
|
|
305
|
+
<drilldown><link target="_blank">search?q=status%3D$click.name2$</link></drilldown>
|
|
306
|
+
</chart>
|
|
307
|
+
</panel>
|
|
308
|
+
</row>
|
|
309
|
+
<row>
|
|
310
|
+
<panel>
|
|
311
|
+
<title>Top pages</title>
|
|
312
|
+
<chart>
|
|
313
|
+
<search base="base"><query>search uri="*$uri_tok$*" | top limit=10 uri</query></search>
|
|
314
|
+
<option name="charting.chart">bar</option>
|
|
315
|
+
</chart>
|
|
316
|
+
</panel>
|
|
317
|
+
<panel>
|
|
318
|
+
<table>
|
|
319
|
+
<title>Server errors</title>
|
|
320
|
+
<search>
|
|
321
|
+
<query>\`web_index\` ($status_tok$) host=$host_tok$ | stats count, latest(_time) as last_seen by host, status | sort - count</query>
|
|
322
|
+
<earliest>-4h@h</earliest>
|
|
323
|
+
<latest>now</latest>
|
|
324
|
+
</search>
|
|
325
|
+
</table>
|
|
326
|
+
</panel>
|
|
327
|
+
</row>
|
|
328
|
+
<row>
|
|
329
|
+
<panel>
|
|
330
|
+
<chart>
|
|
331
|
+
<title>Session length</title>
|
|
332
|
+
<search><query>\`web_index\` | transaction JSESSIONID maxpause=5m | timechart avg(duration)</query></search>
|
|
333
|
+
<option name="charting.chart">area</option>
|
|
334
|
+
</chart>
|
|
335
|
+
</panel>
|
|
336
|
+
<panel>
|
|
337
|
+
<table>
|
|
338
|
+
<title>Slow requests</title>
|
|
339
|
+
<search ref="Web - slow requests"/>
|
|
340
|
+
</table>
|
|
341
|
+
</panel>
|
|
342
|
+
<panel>
|
|
343
|
+
<html>
|
|
344
|
+
<h3>Runbook</h3>
|
|
345
|
+
<p>Page <b>web-oncall</b> when the error rate stays above 5% for ten minutes. See <a href="https://wiki.example.com/web">the web runbook</a>.</p>
|
|
346
|
+
</html>
|
|
347
|
+
</panel>
|
|
348
|
+
</row>
|
|
349
|
+
</form>
|
|
350
|
+
`,j=`[failed_ssh]
|
|
351
|
+
search = sourcetype=linux_secure "Failed password"
|
|
352
|
+
|
|
353
|
+
[sudo_session]
|
|
354
|
+
search = sourcetype=linux_secure "sudo:" "session opened"
|
|
355
|
+
`,M=`[web_index]
|
|
356
|
+
definition = index=web
|
|
357
|
+
|
|
358
|
+
[security_content_summariesonly]
|
|
359
|
+
definition = summariesonly=false allow_old_summaries=true fillnull_value=NULL
|
|
360
|
+
|
|
361
|
+
[security_content_ctime(1)]
|
|
362
|
+
args = field
|
|
363
|
+
definition = convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
|
|
364
|
+
|
|
365
|
+
[business_hours]
|
|
366
|
+
definition = if(tonumber(strftime(now(), "%H")) >= 9, "date_hour>=9 date_hour<17", "date_hour>=0")
|
|
367
|
+
iseval = 1
|
|
368
|
+
`,N=`[linux_secure]
|
|
369
|
+
EXTRACT-ssh_failure = Failed password for (?:invalid user )?(?<user>\\S+) from (?<src_ip>\\d+\\.\\d+\\.\\d+\\.\\d+) port (?<src_port>\\d+)
|
|
370
|
+
REPORT-sshd = sshd_pid, sshd_csv
|
|
371
|
+
|
|
372
|
+
[access_combined]
|
|
373
|
+
EXTRACT-request = "(?<method>GET|POST|PUT|DELETE|HEAD) (?<uri>\\S+) HTTP/1\\.\\d" (?<status>\\d{3}) (?<bytes>\\d+)
|
|
374
|
+
`,P=`# Saved searches of the sample app. Each stanza is one search.
|
|
375
|
+
|
|
376
|
+
[default]
|
|
377
|
+
dispatch.earliest_time = -24h@h
|
|
378
|
+
dispatch.latest_time = now
|
|
379
|
+
|
|
380
|
+
[Web - error rate by host]
|
|
381
|
+
description = Share of server errors per host
|
|
382
|
+
search = \`web_index\` sourcetype=access_combined \\
|
|
383
|
+
| stats count as total, count(eval(status>=500)) as errors by host \\
|
|
384
|
+
| eval error_pct=round(errors/total*100, 2) \\
|
|
385
|
+
| where error_pct > 1 \\
|
|
386
|
+
| sort - error_pct
|
|
387
|
+
|
|
388
|
+
[Web - slow requests]
|
|
389
|
+
search = \`web_index\` sourcetype=access_combined \\
|
|
390
|
+
| rex "duration=(?<duration_ms>\\d+)" \\
|
|
391
|
+
| where duration_ms > 2000 \\
|
|
392
|
+
| stats count, avg(duration_ms) as avg_ms by uri \\
|
|
393
|
+
| sort - count
|
|
394
|
+
dispatch.earliest_time = -60m@m
|
|
395
|
+
cron_schedule = */15 * * * *
|
|
396
|
+
enableSched = 1
|
|
397
|
+
|
|
398
|
+
[Web - hosts not reporting]
|
|
399
|
+
search = \`web_index\` | stats latest(_time) as last_seen by host | eval idle_min=round((now()-last_seen)/60, 0) | where idle_min > 15
|
|
400
|
+
dispatch.earliest_time = -4h
|
|
401
|
+
cron_schedule = */5 * * * *
|
|
402
|
+
enableSched = 1
|
|
403
|
+
|
|
404
|
+
[Auth - failed SSH logins by source]
|
|
405
|
+
description = Brute force candidates
|
|
406
|
+
search = eventtype=failed_ssh | stats count by src_ip, user | where count > 5 | sort - count
|
|
407
|
+
|
|
408
|
+
[Auth - privileged sessions]
|
|
409
|
+
search = tag=privileged tag=authentication | stats count by user, host
|
|
410
|
+
|
|
411
|
+
[Auth - failures from the data model]
|
|
412
|
+
search = | tstats summariesonly=true count from datamodel=Authentication where Authentication.action=failure by Authentication.user, Authentication.src \\
|
|
413
|
+
| \`drop_dm_object_name(Authentication)\` \\
|
|
414
|
+
| where count > 10
|
|
415
|
+
|
|
416
|
+
[Endpoint - encoded PowerShell]
|
|
417
|
+
search = | tstats \`security_content_summariesonly\` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name=powershell.exe Processes.process="*-enc*" by Processes.dest Processes.user Processes.process \\
|
|
418
|
+
| \`drop_dm_object_name(Processes)\` \\
|
|
419
|
+
| \`security_content_ctime(firstTime)\` \\
|
|
420
|
+
| \`security_content_ctime(lastTime)\`
|
|
421
|
+
|
|
422
|
+
[Web - sessions (needs manual work)]
|
|
423
|
+
search = \`web_index\` | transaction JSESSIONID maxpause=5m | stats avg(duration) as avg_session, avg(eventcount) as avg_pages
|
|
424
|
+
|
|
425
|
+
[Old weekly report]
|
|
426
|
+
disabled = 1
|
|
427
|
+
search = index=legacy | top 20 uri
|
|
428
|
+
`,F=`[eventtype=failed_ssh]
|
|
429
|
+
authentication = enabled
|
|
430
|
+
failure = enabled
|
|
431
|
+
|
|
432
|
+
[eventtype=sudo_session]
|
|
433
|
+
authentication = enabled
|
|
434
|
+
privileged = enabled
|
|
435
|
+
|
|
436
|
+
[host=bastion%2D01]
|
|
437
|
+
privileged = enabled
|
|
438
|
+
`,I=`[sshd_pid]
|
|
439
|
+
REGEX = sshd\\[(\\d+)\\]
|
|
440
|
+
FORMAT = pid::$1
|
|
441
|
+
|
|
442
|
+
[sshd_csv]
|
|
443
|
+
DELIMS = ","
|
|
444
|
+
FIELDS = facility, severity
|
|
445
|
+
`,L=`# A filled-in mapping for the sample app: where its data would live in Grail.
|
|
446
|
+
# macros, extractions, eventtypes and tags are not here — spl2dql reads them from the .conf files.
|
|
447
|
+
version: 1
|
|
448
|
+
|
|
449
|
+
indexes:
|
|
450
|
+
web:
|
|
451
|
+
dataObject: logs
|
|
452
|
+
buckets: [web_logs]
|
|
453
|
+
firewall:
|
|
454
|
+
dataObject: logs
|
|
455
|
+
buckets: [firewall_logs]
|
|
456
|
+
legacy:
|
|
457
|
+
dataObject: logs
|
|
458
|
+
|
|
459
|
+
sourcetypes:
|
|
460
|
+
access_combined:
|
|
461
|
+
filter: 'log.source == "/var/log/nginx/access.log"'
|
|
462
|
+
linux_secure:
|
|
463
|
+
filter: 'log.source == "/var/log/secure"'
|
|
464
|
+
|
|
465
|
+
fields:
|
|
466
|
+
action: event.outcome
|
|
467
|
+
src_zone: source.zone
|
|
468
|
+
dest_zone: destination.zone
|
|
469
|
+
|
|
470
|
+
fieldTypes:
|
|
471
|
+
status: number
|
|
472
|
+
bytes: number
|
|
473
|
+
duration_ms: number
|
|
474
|
+
|
|
475
|
+
datamodels:
|
|
476
|
+
Authentication:
|
|
477
|
+
dataObject: logs
|
|
478
|
+
buckets: [auth_logs]
|
|
479
|
+
filter: 'event.category == "authentication"'
|
|
480
|
+
fields:
|
|
481
|
+
user: user.name
|
|
482
|
+
src: client.ip
|
|
483
|
+
action: event.outcome
|
|
484
|
+
Endpoint.Processes:
|
|
485
|
+
dataObject: logs
|
|
486
|
+
filter: 'event.type == "process"'
|
|
487
|
+
fields:
|
|
488
|
+
process_name: process.executable.name
|
|
489
|
+
process: process.command_line
|
|
490
|
+
dest: host.name
|
|
491
|
+
user: user.name
|
|
492
|
+
`,R=(e,t)=>({path:e,size:t.length,text:t}),z=L,B=[R(`sample-app/default/savedsearches.conf`,P),R(`sample-app/default/macros.conf`,M),R(`sample-app/default/props.conf`,N),R(`sample-app/default/transforms.conf`,I),R(`sample-app/default/eventtypes.conf`,j),R(`sample-app/default/tags.conf`,F),R(`sample-app/default/data/ui/views/web_overview.xml`,A),R(`sample-app/default/data/ui/views/security_posture.xml`,k)],V=n(),H=C+1;async function U(e){let t=[];for(let n of[...e.items]){let e=n.webkitGetAsEntry?.();e&&t.push(e)}if(t.length===0||t.every(e=>e.isFile))return[...e.files];let n=[],r=async e=>{if(n.length>=H)return;if(e.isFile&&e.file){let t=await new Promise(t=>e.file?.(t,()=>t(void 0)));t&&n.push(t);return}let t=e.createReader?.();if(t)for(;;){let e=await new Promise(e=>t.readEntries(e,()=>e([])));if(e.length===0)break;for(let t of e)await r(t)}};for(let e of t)await r(e);return n}function W(e){let[t,n]=(0,S.useState)(!1),[i,a]=(0,S.useState)(!1),[o,s]=(0,S.useState)(),c=(0,S.useRef)(null),l=(0,S.useRef)(null),u=async(e,t=!1)=>{if(e.length!==0){s(void 0),a(!0);try{await O(e,{sample:t})}catch(e){s(e instanceof r?e.message:`These files could not be read.`)}finally{a(!1)}}};return(0,V.jsxs)(`div`,{className:`flex flex-col items-start gap-3 border-2 border-dashed ${e.compact?`p-4`:`p-6`} ${t?`border-exact bg-surface`:`border-line`}`,onDragOver:e=>{e.preventDefault(),n(!0)},onDragLeave:()=>n(!1),onDrop:e=>{e.preventDefault(),n(!1),U(e.dataTransfer).then(e=>u(e.map(w)))},"data-testid":`dropzone`,children:[(0,V.jsx)(`p`,{className:`font-semibold`,children:e.title}),(0,V.jsx)(`div`,{className:`max-w-[70ch] text-sm text-muted`,children:e.children}),(0,V.jsx)(`input`,{ref:c,type:`file`,multiple:!0,accept:`.spl,.txt,.csv,.conf,.xml,.json`,className:`sr-only`,onChange:e=>{e.target.files&&u([...e.target.files].map(w)),e.target.value=``},"aria-label":`Choose files`}),(0,V.jsx)(`input`,{ref:l,type:`file`,multiple:!0,className:`sr-only`,onChange:e=>{e.target.files&&u([...e.target.files].map(w)),e.target.value=``},"aria-label":`Choose a folder`,webkitdirectory:``}),(0,V.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,V.jsxs)(`button`,{type:`button`,className:`control`,onClick:()=>c.current?.click(),disabled:i,children:[(0,V.jsx)(x,{size:16,"aria-hidden":!0}),i?`Working…`:`Choose files`]}),(0,V.jsxs)(`button`,{type:`button`,className:`control`,onClick:()=>l.current?.click(),disabled:i,children:[(0,V.jsx)(y,{size:16,"aria-hidden":!0}),`Choose a folder`]}),e.sample&&(0,V.jsx)(`button`,{type:`button`,className:`control quiet`,onClick:()=>void u(B,!0),disabled:i,children:`Load the sample app`})]}),o&&(0,V.jsxs)(`p`,{className:`text-sm`,role:`alert`,children:[(0,V.jsxs)(`span`,{className:`mark-error`,"aria-hidden":`true`,children:[`■`,` `]}),o]})]})}function G(e){let t=u(e=>e.ingestNote),n=u(e=>e.setView);if(!t)return null;let r=[];return t.searches>0&&e.here!==`batch`&&r.push({view:`batch`,label:`${t.searches} search${t.searches===1?``:`es`} translated`}),t.dashboards>0&&e.here!==`dashboards`&&r.push({view:`dashboards`,label:`${t.dashboards} dashboard${t.dashboards===1?``:`s`} converted`}),t.added>0&&e.here!==`mapping`&&r.push({view:`mapping`,label:`${t.added} definition${t.added===1?``:`s`} added to the mapping`}),r.length===0&&t.skipped.length===0&&t.problems.length===0&&!t.example&&!t.overBudget&&!(e.here===`mapping`&&t.added>0)?null:(0,V.jsxs)(`div`,{className:`mt-3 space-y-2 text-sm`,"data-testid":`ingest-summary`,children:[(0,V.jsx)(q,{note:t}),t.example&&(0,V.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsxs)(`span`,{className:`mark-info`,"aria-hidden":`true`,children:[`●`,` `]}),`Converted with the example mapping. Your own files need yours.`]}),e.here!==`mapping`&&(0,V.jsx)(`button`,{type:`button`,className:`control`,onClick:()=>n(`mapping`),children:`Open Mapping`})]}),e.here===`mapping`&&t.added>0&&(0,V.jsxs)(`p`,{children:[(0,V.jsxs)(`span`,{className:`mark-exact`,"aria-hidden":`true`,children:[`●`,` `]}),t.added,` definition`,t.added===1?``:`s`,` added from the Splunk configuration files.`]}),r.length>0&&(0,V.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,V.jsx)(`span`,{className:`text-muted`,children:`Also in these files:`}),r.map(e=>(0,V.jsx)(`button`,{type:`button`,className:`control`,onClick:()=>n(e.view),children:e.label},e.view))]}),a(t.problems,d.list).map(e=>(0,V.jsxs)(`p`,{children:[(0,V.jsxs)(`span`,{className:`mark-check`,"aria-hidden":`true`,children:[`▲`,` `]}),e]},e)),(0,V.jsx)(l,{total:t.problems.length,limit:d.list,noun:`problems`}),(0,V.jsx)(J,{note:t})]})}var K=(e,t,n)=>`${e} ${e===1?t:n}`;function q(e){let t=e.note.overBudget;if(!t)return null;let n=[...t.searches.length>0?[K(t.searches.length,`search`,`searches`)]:[],...t.dashboards.length>0?[K(t.dashboards.length,`dashboard`,`dashboards`)]:[]],r=t.searches.length+t.dashboards.length,i=a(t.dashboards,d.list),o=a(t.searches,d.list-i.length);return(0,V.jsxs)(`div`,{"data-testid":`over-budget`,children:[(0,V.jsxs)(`p`,{className:`font-semibold`,children:[(0,V.jsxs)(`span`,{className:`mark-untranslated`,"aria-hidden":`true`,children:[`■`,` `]}),`These files produce more than 50 MB of DQL. The rest was not translated; choose fewer files at once.`]}),(0,V.jsxs)(`details`,{className:`mt-1`,children:[(0,V.jsxs)(`summary`,{className:`cursor-pointer`,"data-testid":`not-translated-count`,children:[n.join(` and `),` `,r===1?`was`:`were`,` not translated`]}),(0,V.jsxs)(`ul`,{className:`mt-2 max-h-64 space-y-1 overflow-auto border-l-2 border-line pl-3`,children:[i.map((e,t)=>(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e}),` `,(0,V.jsx)(`span`,{className:`text-muted`,children:`(dashboard)`})]},`d-${t}`)),o.map((e,t)=>(0,V.jsx)(`li`,{children:(0,V.jsx)(`span`,{className:`[overflow-wrap:anywhere]`,children:e})},`s-${t}`))]}),(0,V.jsx)(l,{total:r,limit:d.list,noun:`names`,className:`mt-1`})]})]})}function J(e){let{skipped:t}=e.note;return t.length===0?null:(0,V.jsxs)(`details`,{children:[(0,V.jsxs)(`summary`,{className:`cursor-pointer`,children:[(0,V.jsxs)(`span`,{className:`mark-check`,"aria-hidden":`true`,children:[`▲`,` `]}),t.length,` definition`,t.length===1?``:`s`,` could not be carried over`]}),(0,V.jsx)(`ul`,{className:`mt-2 max-h-64 space-y-1 overflow-auto border-l-2 border-line pl-3`,children:a(t,d.list).map(e=>(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`span`,{className:`font-code text-xs`,children:e.name}),` `,(0,V.jsx)(`span`,{className:`text-muted`,children:e.reason})]},`${e.name}-${e.reason}`))}),(0,V.jsx)(l,{total:t.length,limit:d.list,noun:`definitions`,className:`mt-1`})]})}export{_ as a,x as i,G as n,z as r,W as t};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{a as e,i as t,m as n,n as r,r as i,w as a,x as o}from"./index-BO3AM1fZ.js";import{t as s}from"./dict-9ToLi8Te.js";import{a as c,i as l,n as u,r as d,t as f}from"./DropZone-CIbk77sc.js";import{a as p,n as m,t as h}from"./jsx-runtime-Wy9s6hX0.js";import{c as g,i as _,l as v,o as y,r as ee,s as te,t as b,u as x}from"./mapping-text-B64_Oh2A.js";var S=Object.freeze(Object.assign(Object.create(null),{append:[],data:[`json`],dedup:[`direction`,`filterPushThrough`,`limit`,`sort`],describe:[],expand:[`limit`],fetch:[`bucket`,`from`,`samplingRatio`,`scanLimitGBytes`,`timeframe`,`to`],fields:[],fieldsAdd:[],fieldsFlatten:[`depth`,`fields`,`prefix`],fieldsKeep:[],fieldsRemove:[],fieldsRename:[],fieldsSnapshot:[`bucket`,`by`],fieldsSummary:[`extrapolateSamples`,`topValues`],filter:[],filterOut:[],join:[`broadcast`,`executionOrder`,`fields`,`kind`,`on`,`prefix`],joinNested:[`broadcast`,`executionOrder`,`fields`,`on`],limit:[],load:[`offset`],lookup:[`broadcast`,`executionOrder`,`fields`,`lookupField`,`prefix`,`sourceField`],makeTimeseries:[`bins`,`by`,`default`,`from`,`interval`,`nonempty`,`rate`,`spread`,`time`,`timeframe`,`to`],metrics:[`bucket`,`from`,`timeframe`,`to`],parse:[`baseTime`,`parsingPrerequisite`,`preserveFieldsOnFailure`],search:[`caseSensitive`,`scope`],smartscapeEdges:[`from`,`timeframe`,`to`],smartscapeNodes:[`from`,`timeframe`,`to`],sort:[`direction`],summarize:[`by`],timeseries:[`bins`,`bucket`,`by`,`default`,`filter`,`from`,`interval`,`nonempty`,`rate`,`rollup`,`shift`,`timeframe`,`to`,`union`],traverse:[`direction`,`fieldsKeep`,`nodeId`]})),C=Object.freeze(Object.assign(Object.create(null),{abs:[],acos:[],array:[],arrayAvg:[],arrayConcat:[],arrayCumulativeSum:[],arrayDelta:[],arrayDiff:[],arrayDistinct:[],arrayElement:[],arrayFirst:[],arrayFlatten:[],arrayIndexOf:[],arrayLast:[],arrayLastIndexOf:[],arrayMax:[],arrayMedian:[],arrayMin:[],arrayMovingAvg:[],arrayMovingMax:[],arrayMovingMin:[],arrayMovingSum:[],arrayPercentile:[],arrayRemoveNulls:[],arrayReverse:[],arraySize:[],arraySlice:[`from`,`to`],arraySort:[`direction`],arraySum:[],arrayToString:[`delimiter`],asArray:[],asBinary:[],asBoolean:[],asDouble:[],asDuration:[],asIp:[],asLong:[],asNumber:[],asRecord:[],asSmartscapeId:[],asString:[],asTimeframe:[],asTimestamp:[],asUid:[],asin:[],atan:[],atan2:[],avg:[`default`,`filter`,`rate`,`rollup`,`scalar`],bin:[`at`],bitwiseAnd:[],bitwiseCountOnes:[],bitwiseNot:[],bitwiseOr:[],bitwiseShiftLeft:[],bitwiseShiftRight:[`ignoreSign`],bitwiseXor:[],cbrt:[],ceil:[],classicEntitySelector:[],coalesce:[],collectArray:[`expand`,`maxLength`],collectDistinct:[`expand`,`maxLength`],concat:[`delimiter`],contains:[`caseSensitive`],correlation:[],cos:[],cosh:[],count:[`default`,`filter`,`rate`,`scalar`],countDistinct:[`default`,`filter`,`precision`,`rate`,`scalar`],countDistinctApprox:[`default`,`precision`,`rate`,`scalar`],countDistinctExact:[`default`,`rate`,`scalar`],countIf:[`default`,`rate`,`scalar`],decodeBase16ToBinary:[],decodeBase16ToString:[],decodeBase64ToBinary:[],decodeBase64ToString:[],decodeUrl:[],degreeToRadian:[],duration:[],e:[],encodeBase16:[],encodeBase64:[],encodeUrl:[],end:[],endsWith:[`caseSensitive`],entityAttr:[`type`],entityName:[`type`],escape:[],exists:[],exp:[],floor:[],formatTimestamp:[`format`,`interval`,`locale`,`timezone`],getCharacter:[],getDayOfMonth:[`timezone`],getDayOfWeek:[`timezone`],getDayOfYear:[`timezone`],getEnd:[],getHighBits:[],getHour:[`timezone`],getLowBits:[],getMinute:[`timezone`],getMonth:[`timezone`],getNodeField:[],getNodeName:[],getSecond:[`timezone`],getStart:[],getWeekOfYear:[`timezone`],getYear:[`timezone`],hashCrc32:[],hashMd5:[],hashSha1:[],hashSha256:[],hashSha512:[],hashXxHash32:[],hashXxHash64:[],hexStringToNumber:[],hypotenuse:[],iAny:[],iCollectArray:[],iIndex:[],if:[`else`],in:[],indexOf:[`from`],ip:[],ipIn:[],ipIsLinkLocal:[],ipIsLoopback:[],ipIsPrivate:[],ipIsPublic:[],ipMask:[`ipv6MaskBits`],isFalseOrNull:[],isIp:[],isIpV4:[],isIpV6:[],isNotNull:[],isNull:[],isTrueOrNull:[],isUid128:[],isUid64:[],isUuid:[],jsonField:[`seek`],jsonPath:[`seek`],lastIndexOf:[`from`],levenshteinDistance:[],like:[],log:[],log10:[],log1p:[],lookup:[`broadcast`,`executionOrder`,`lookupField`,`sourceField`],lower:[],matchesPattern:[],matchesPhrase:[`caseSensitive`,`wildcard`],matchesRegex:[],matchesValue:[`caseSensitive`,`wildcard`],max:[`default`,`filter`,`rate`,`rollup`,`scalar`],median:[`default`,`filter`,`rate`,`rollup`,`scalar`,`weight`],min:[`default`,`filter`,`rate`,`rollup`,`scalar`],now:[],numberToHexString:[`minLength`],parse:[`baseTime`],parseAll:[`baseTime`],percentRank:[`default`,`filter`,`rate`,`rollup`,`scalar`],percentile:[`default`,`filter`,`rate`,`rollup`,`scalar`,`weight`],percentileFromSamples:[`default`,`originalCount`,`rate`,`scalar`],percentiles:[`weight`],pi:[],power:[],punctuation:[`count`,`withSpace`],radianToDegree:[],random:[],range:[`at`],record:[],replacePattern:[],replaceString:[],round:[`decimals`],signum:[],sin:[],sinh:[],smartscapeId:[],splitByPattern:[],splitString:[],sqrt:[],start:[],startsWith:[`caseSensitive`],stddev:[],stringLength:[],substring:[`from`,`to`],sum:[`default`,`filter`,`rate`,`rollup`,`scalar`],takeAny:[],takeFirst:[],takeLast:[],takeMax:[],takeMin:[],tan:[],tanh:[],timeframe:[`to`],timestamp:[`micros`,`millis`,`nanos`,`timezone`],timestampFromUnixMillis:[],timestampFromUnixNanos:[],timestampFromUnixSeconds:[],toArray:[],toBoolean:[],toDouble:[],toDuration:[],toIp:[],toLong:[],toSmartscapeId:[],toString:[],toTimeframe:[],toTimestamp:[],toUid:[],toVariant:[],trim:[],type:[`withSubtype`],uid128:[],uid64:[],unescape:[],unescapeHtml:[],unixMillisFromTimestamp:[],unixNanosFromTimestamp:[],unixSecondsFromTimestamp:[],upper:[],uuid:[],variance:[],vectorCosineDistance:[],vectorInnerProductDistance:[],vectorL1Distance:[],vectorL2Distance:[]})),w=256,T=1e6;function E(e){return D(e,e=>{e.expr(),e.expectEof()})}function D(e,t){let n={commands:[],calls:[]};if(e.length>T)return n.error={message:`The query is too long.`,span:{start:0,end:0}},n;let r=new ne(a(e).filter(e=>e.type!==`comment`),n);try{t(r)}catch(e){if(!(e instanceof O))throw e;n.error={message:e.message,span:e.span}}return n}var O=class extends Error{span;constructor(e,t){super(e),this.span=t}},ne=class e{i=0;depth=0;tokens;out;constructor(e,t){this.tokens=e,this.out=t}get t(){return this.tokens[this.i]??this.tokens[this.tokens.length-1]}peek(e=1){return this.tokens[this.i+e]??this.tokens[this.tokens.length-1]}is(e){return this.t.type===`punct`&&this.t.text===e}isWord(e){return this.t.type===`ident`&&this.t.text===e}next(){let e=this.t;if(e.type===`error`)throw new O(k(e),e.span);return this.i++,e}expect(e){return this.is(e)||this.fail(`Expected "${e}"`),this.next()}fail(e){let t=this.t;throw t.type===`error`?new O(k(t),t.span):new O(`${e}, found ${t.type===`eof`?`end of query`:`"${t.text}"`}.`,t.span)}enter(){if(++this.depth>w)throw new O(`The query is nested too deeply.`,this.t.span)}leave(){this.depth--}expectEof(){this.t.type!==`eof`&&this.fail(`Unexpected text`)}query(){for(this.command();this.is(`|`);)this.next(),this.command()}command(){this.t.type!==`ident`&&this.fail(`Expected a command name`);let e=this.next(),t={name:e.text,span:e.span,named:[]};if(this.out.commands.push(t),!this.atArgsEnd()){for(this.argument(t.named);this.is(`,`);)this.next(),this.argument(t.named);this.atArgsEnd()||this.fail(`Expected "," or "|"`)}}atArgsEnd(){return this.t.type===`eof`||this.is(`|`)||this.is(`]`)}argument(e){if(this.t.type===`ident`&&this.peek().type===`punct`&&this.peek().text===`:`){let t=this.next();e.push({name:t.text,span:t.span}),this.next(),this.valueWithDirection()}else this.valueWithDirection()}valueWithDirection(){this.assignOrExpr(),(this.isWord(`asc`)||this.isWord(`desc`))&&this.next()}assignOrExpr(){let e=this.i;if(this.t.type===`backtick`||this.t.type===`ident`){for(this.next();this.is(`.`)&&(this.peek().type===`ident`||this.peek().type===`backtick`);)this.next(),this.next();if(this.is(`=`)){this.next(),this.expr();return}this.i=e}this.expr()}expr(){this.enter(),this.binary(0),this.leave()}static LEVELS=[[`or`],[`xor`],[`and`],[`==`,`!=`,`<`,`<=`,`>`,`>=`,`in`],[`+`,`-`],[`*`,`/`,`%`]];binary(t){let n=e.LEVELS[t];if(!n)this.unary();else if(t===3)this.notLevel();else for(this.binary(t+1);this.isOp(n);)this.next(),this.binary(t+1)}notLevel(){if(this.isWord(`not`)){this.next(),this.enter(),this.notLevel(),this.leave();return}this.binary(4);let t=e.LEVELS[3]??[];for(;this.isOp(t);)this.next(),this.binary(4)}isOp(e){let t=this.t;return t.type===`punct`||t.type===`ident`?e.includes(t.text):!1}unary(){this.is(`-`)||this.is(`+`)?(this.next(),this.enter(),this.unary(),this.leave()):this.postfix()}postfix(){for(this.primary();;)if(this.is(`[`))this.next(),this.is(`]`)||this.expr(),this.expect(`]`);else if(this.t.type===`align`)this.next();else return}primary(){let e=this.t;switch(e.type){case`number`:case`duration`:case`string`:case`align`:this.next();return;case`backtick`:this.next();return;case`ident`:if(this.peek().type===`punct`&&this.peek().text===`(`){this.call();return}for(this.next();this.is(`.`)&&(this.peek().type===`ident`||this.peek().type===`backtick`);)this.next(),this.next();return;case`punct`:if(e.text===`(`){this.next(),this.expr(),this.expect(`)`);return}if(e.text===`{`){if(this.next(),this.enter(),!this.is(`}`))for(this.valueWithDirection();this.is(`,`);)this.next(),this.valueWithDirection();this.expect(`}`),this.leave();return}if(e.text===`[`){this.next(),this.enter(),this.query(),this.leave(),this.expect(`]`);return}this.fail(`Expected a value`);return;default:this.fail(`Expected a value`)}}call(){let e=this.next(),t={fn:e.text,span:e.span,named:[]};if(this.out.calls.push(t),this.expect(`(`),this.enter(),!this.is(`)`))for(this.callArg(t);this.is(`,`);)this.next(),this.callArg(t);this.leave(),this.expect(`)`)}callArg(e){if(this.t.type===`ident`&&this.peek().type===`punct`&&this.peek().text===`:`){let t=this.next();e.named.push({name:t.text,span:t.span}),this.next()}this.assignOrExpr()}};function k(e){return e.text.startsWith(`"`)||e.text.startsWith(`'`)?`A string is not closed.`:e.text.startsWith("`")?`A backtick-quoted name is not closed.`:`Unexpected character "${e.text}".`}function A(e){let t=M(E(e)),n=a(e).find(e=>e.type===`comment`);return n?{ok:!1,issues:[...t.issues,{severity:`error`,message:`Comments are not allowed here.`,span:n.span}]}:t}var j=s({});function M(e){let t=[];e.error&&t.push({severity:`error`,message:e.error.message,span:e.error.span});for(let n of e.commands){let e=Object.hasOwn(S,n.name)?S[n.name]:void 0;if(!e)t.push({severity:`error`,message:`Unknown command "${n.name}".`,span:n.span});else for(let r of n.named)e.includes(r.name)||t.push({severity:`error`,message:`"${n.name}" has no parameter "${r.name}".`,span:r.span})}for(let n of e.calls){if(!Object.hasOwn(C,n.fn)){t.push({severity:`error`,message:`Unknown function "${n.fn}".`,span:n.span});continue}let e=[...C[n.fn]??[],...j[n.fn]??[]];for(let r of n.named)e.includes(r.name)||t.push({severity:`error`,message:`"${n.fn}" has no parameter "${r.name}".`,span:r.span})}return t.sort((e,t)=>e.span.start-t.span.start),{ok:!t.some(e=>e.severity===`error`),issues:t}}function N(){return{version:1,defaults:{dataObject:`logs`,timezone:`UTC`},indexes:new Map,sourcetypes:new Map,fields:new Map,fieldTypes:new Map,extractions:new Map,macros:new Map,lookups:new Map,eventtypes:new Map,tags:new Map,metrics:new Map,datamodels:new Map}}var P=[`version`,`defaults`,`indexes`,`sourcetypes`,`fields`,`fieldTypes`,`extractions`,`macros`,`lookups`,`eventtypes`,`tags`,`metrics`,`datamodels`],F=/^[a-z][a-z0-9_.]{0,63}$/,I=/^[A-Za-z0-9_-]{1,128}$/,L=/^[A-Za-z_@][A-Za-z0-9_.:@-]{0,255}$/,R=/^\/lookups\/[A-Za-z0-9_.-]+(\/[A-Za-z0-9_.-]+)*$/,z=/^[^\s`"|[\]]{1,256}$/,B=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*){0,7}$/,V=/^-?\d+(s|m|h|d|w|M|q|y)(@[a-zA-Z0-9]+)?$/,H=[`number`,`string`,`time`,`duration`,`boolean`,`ip`],U=1e4,W=1e4;function G(e){let t=[],n=N(),r=new K(t);if(!q(e))return{ok:!1,issues:[{path:``,message:`The mapping file must be a map of sections.`}]};for(let n of Object.keys(e))P.includes(n)||t.push({path:`/${J(n)}`,message:`Unknown section "${n}".`});e.version!==1&&t.push({path:`/version`,message:`Set "version: 1".`});let i=e.defaults;return i!==void 0&&r.record(i,`/defaults`,[`dataObject`,`timeframe`,`timezone`])&&(i.dataObject!==void 0&&r.pattern(i.dataObject,`/defaults/dataObject`,F,`a data object name such as "logs"`)&&(n.defaults.dataObject=i.dataObject),i.timeframe!==void 0&&i.timeframe!==null&&r.pattern(i.timeframe,`/defaults/timeframe`,V,`a relative time such as "-24h"`)&&(n.defaults.timeframe=i.timeframe),i.timezone!==void 0&&(r.string(i.timezone,`/defaults/timezone`)&&re(i.timezone)?n.defaults.timezone=i.timezone:typeof i.timezone==`string`&&t.push({path:`/defaults/timezone`,message:`"${i.timezone}" is not a known time zone.`}))),n.indexes=r.section(e.indexes,`/indexes`,z,(e,t)=>{if(!r.record(e,t,[`dataObject`,`buckets`,`filter`]))return;let i={dataObject:n.defaults.dataObject,buckets:[]};if(e.dataObject!==void 0&&r.pattern(e.dataObject,`${t}/dataObject`,F,`a data object name such as "logs"`)&&(i.dataObject=e.dataObject),e.buckets!==void 0&&(i.buckets=r.stringList(e.buckets,`${t}/buckets`,I,`a bucket name`)),e.filter!==void 0){let n=r.dqlFilter(e.filter,`${t}/filter`);n!==void 0&&(i.filter=n)}return i}),n.sourcetypes=r.section(e.sourcetypes,`/sourcetypes`,z,(e,t)=>{if(!r.record(e,t,[`filter`,`extractions`]))return;let n={extractions:[]};if(e.filter!==void 0){let i=r.dqlFilter(e.filter,`${t}/filter`);i!==void 0&&(n.filter=i)}return e.extractions!==void 0&&(n.extractions=r.stringList(e.extractions,`${t}/extractions`,z,`a field name`)),n}),n.fields=r.section(e.fields,`/fields`,z,(e,t)=>r.pattern(e,t,L,`a Grail field name such as "host.name"`)?e:void 0),n.fieldTypes=r.section(e.fieldTypes,`/fieldTypes`,L,(e,n)=>{if(typeof e==`string`&&H.includes(e))return e;t.push({path:n,message:`Use one of: ${H.join(`, `)}.`})}),n.extractions=r.section(e.extractions,`/extractions`,z,(e,t)=>{if(!r.record(e,t,[`from`,`dpl`]))return;let n=e.from===void 0?`content`:e.from;if(r.pattern(n,`${t}/from`,L,`a Grail field name`)&&r.text(e.dpl,`${t}/dpl`))return{from:n,dpl:e.dpl}}),n.macros=r.section(e.macros,`/macros`,/^[A-Za-z0-9_.:-]+(\(\d{1,2}\))?$/,(e,n,i)=>{let a=typeof e==`string`?e:q(e)?e.definition:void 0;if(q(e)&&!r.record(e,n,[`args`,`definition`])||!r.text(a,typeof e==`string`?n:`${n}/definition`))return;let o=q(e)&&e.args!==void 0?r.stringList(e.args,`${n}/args`,/^[A-Za-z_][A-Za-z0-9_]{0,63}$/,`an argument name`):[],s=/\((\d+)\)$/.exec(i),c=s?Number(s[1]):0;if(c!==o.length)t.push({path:n,message:`The macro name says ${c} argument(s) but "args" lists ${o.length}.`});else return{args:o,definition:a}}),n.lookups=r.section(e.lookups,`/lookups`,z,(e,n)=>{if(!r.record(e,n,[`path`,`key`,`columns`])||!r.pattern(e.path,`${n}/path`,R,`a Grail file path starting with "/lookups/"`))return;if(e.path.includes(`..`)){t.push({path:`${n}/path`,message:`The path must not contain "..".`});return}let i={path:e.path};return e.key!==void 0&&r.pattern(e.key,`${n}/key`,L,`a column name`)&&(i.key=e.key),e.columns!==void 0&&(i.columns=r.stringList(e.columns,`${n}/columns`,L,`a column name`)),i}),n.eventtypes=r.section(e.eventtypes,`/eventtypes`,z,(e,t)=>r.dqlFilter(e,t)),n.tags=r.section(e.tags,`/tags`,z,(e,t)=>r.dqlFilter(e,t)),n.metrics=r.section(e.metrics,`/metrics`,z,(e,t)=>r.pattern(e,t,L,`a metric key such as "dt.host.cpu.usage"`)?e:void 0),n.datamodels=r.section(e.datamodels,`/datamodels`,B,(e,t)=>{if(!r.record(e,t,[`dataObject`,`buckets`,`filter`,`fields`]))return;let i=n.defaults.dataObject;e.dataObject!==void 0&&r.pattern(e.dataObject,`${t}/dataObject`,F,`a data object name such as "logs"`)&&(i=e.dataObject);let a=e.buckets===void 0?[]:r.stringList(e.buckets,`${t}/buckets`,I,`a bucket name`),o=r.section(e.fields,`${t}/fields`,z,(e,t)=>r.pattern(e,t,L,`a Grail field name such as "user.name"`)?e:void 0),s={dataObject:i,buckets:a,fields:o};if(e.filter!==void 0){let n=r.dqlFilter(e.filter,`${t}/filter`);n!==void 0&&(s.filter=n)}return s}),t.length>0?{ok:!1,issues:t}:{ok:!0,value:n}}var K=class{issues;constructor(e){this.issues=e}record(e,t,n){if(!q(e))return this.issues.push({path:t,message:`Expected a map.`}),!1;for(let r of Object.keys(e))n.includes(r)||this.issues.push({path:`${t}/${J(r)}`,message:`Unknown key "${r}". Allowed: ${n.join(`, `)}.`});return!0}string(e,t){return typeof e==`string`||(this.issues.push({path:t,message:`Expected text.`}),!1)}text(e,t){return this.string(e,t)?e.length===0||e.length>W?(this.issues.push({path:t,message:`Expected 1 to ${W} characters.`}),!1):!0:!1}pattern(e,t,n,r){return typeof e!=`string`||!n.test(e)?(this.issues.push({path:t,message:`Expected ${r}.`}),!1):!0}stringList(e,t,n,r){if(!Array.isArray(e))return this.issues.push({path:t,message:`Expected a list.`}),[];if(e.length>U)return this.issues.push({path:t,message:`At most ${U} entries.`}),[];let i=[];return e.forEach((e,a)=>{this.pattern(e,`${t}/${a}`,n,r)&&i.push(e)}),i}dqlFilter(e,t){if(!this.text(e,t))return;let n=A(e);if(n.ok)return e;{let e=n.issues[0];this.issues.push({path:t,message:`Not a valid DQL condition: ${e?.message??`syntax error`}`})}}section(e,t,n,r){let i=new Map;if(e==null)return i;if(!q(e))return this.issues.push({path:t,message:`Expected a map.`}),i;let a=Object.keys(e);if(a.length>U)return this.issues.push({path:t,message:`At most ${U} entries.`}),i;for(let o of a){let a=`${t}/${J(o)}`;if(!n.test(o)){this.issues.push({path:a,message:`"${o}" is not a valid name here.`});continue}let s=r(e[o],a,o);s!==void 0&&i.set(o,s)}return i}};function q(e){if(typeof e!=`object`||!e||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function J(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}var Y=/^(UTC|Z|[+-]\d{2}:\d{2})$/;function re(e){if(Y.test(e))return!0;if(!/^[A-Za-z_]+(\/[A-Za-z0-9_+-]+){0,2}$/.test(e))return!1;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e}),!0}catch{return!1}}var X=p(m(),1),ie=`
|
|
2
|
+
fields:
|
|
3
|
+
level: loglevel
|
|
4
|
+
duration: duration
|
|
5
|
+
fieldTypes:
|
|
6
|
+
duration: number
|
|
7
|
+
lookups:
|
|
8
|
+
http_status:
|
|
9
|
+
path: /lookups/http_status
|
|
10
|
+
key: code
|
|
11
|
+
columns: [code, description, class]
|
|
12
|
+
`,Z;function ae(){if(Z!==void 0)return Z;let e=g(d),t=g(ie);if(v(t.contents))for(let n of t.contents.items){let t=x(n.key)?String(n.key.value):``;if(v(n.value)){e.has(t)||e.set(t,e.createNode({}));for(let r of n.value.items){let n=x(r.key)?String(r.key.value):``;e.hasIn([t,n])||e.setIn([t,n],r.value)}}}return e.commentBefore=` The example mapping: the sample app's spl2dql.mapping.yaml, plus what the built-in examples
|
|
13
|
+
need. Every name in it is made up. It is used only while your own mapping is empty.`,Z=e.toString({lineWidth:0}),Z}var Q=h(),$={indexes:`Indexes`,sourcetypes:`Sourcetypes`,fields:`Fields`,macros:`Macros`,lookups:`Lookups`,eventtypes:`Eventtypes and tags`,metrics:`Metrics`};function oe(){let a=n(e=>e.mappingText),s=n(e=>e.setMappingText),d=n(e=>e.result),p=n(e=>e.mappingUse),m=n(e=>e.mappingFocus),h=n(e=>e.setMappingFocus),g=n(e=>e.forgetMapping),v=(0,X.useRef)(null),x=(0,X.useRef)(null),S=(0,X.useMemo)(()=>{if(a.trim()===``)return[];let e;try{e=te(a,{schema:`core`,maxAliasCount:100,uniqueKeys:!0,merge:!1})}catch(e){return[{path:``,message:e.message.split(`
|
|
14
|
+
`)[0]??`The mapping is not valid YAML.`}]}if(e==null)return[];let t=G(e);return t.ok?[]:t.issues},[a]);(0,X.useEffect)(()=>{if(!m)return;let e=x.current,t=_(a,m.section,m.name);h(void 0),e&&t!==void 0&&(e.dispatch({selection:{anchor:Math.min(t,e.state.doc.length)},scrollIntoView:!0}),e.focus())},[m,a,h]);let C=(0,X.useMemo)(()=>o(p===`example`?[]:d?.diagnostics??[]),[d,p]),w=Object.keys($).filter(e=>C[e].length>0),T=e=>{let t=b(a,[e]);t&&t.added>0&&s(t.text)},E=(e,t)=>T(y(e,t)),D=async e=>{e.size>5242880||s(await e.text())};return(0,Q.jsxs)(`div`,{className:`grid h-full min-h-0 grid-rows-[minmax(300px,1fr)_auto] min-[900px]:grid-cols-[minmax(0,3fr)_minmax(280px,2fr)] min-[900px]:grid-rows-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-col border-line min-[900px]:border-r`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-b border-line bg-surface px-4 py-2`,children:[(0,Q.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Mapping file`}),(0,Q.jsxs)(`div`,{className:`ml-auto flex flex-wrap gap-2`,children:[(0,Q.jsx)(`input`,{ref:v,type:`file`,accept:`.yaml,.yml,.json`,className:`sr-only`,"aria-label":`Import a mapping file`,onChange:e=>e.target.files?.[0]&&void D(e.target.files[0])}),(0,Q.jsxs)(`button`,{type:`button`,className:`control`,onClick:()=>v.current?.click(),children:[(0,Q.jsx)(l,{size:16,"aria-hidden":!0}),`Import`]}),(0,Q.jsxs)(`button`,{type:`button`,className:`control`,onClick:()=>{let e=document.createElement(`a`);e.href=URL.createObjectURL(new Blob([a],{type:`text/yaml`})),e.download=`spl2dql.mapping.yaml`,e.click(),setTimeout(()=>URL.revokeObjectURL(e.href),1e3)},children:[(0,Q.jsx)(c,{size:16,"aria-hidden":!0}),`Download mapping`]}),(0,Q.jsx)(`button`,{type:`button`,className:`control quiet`,onClick:g,children:`Forget mapping`})]})]}),(0,Q.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Q.jsx)(r,{value:a,onChange:s,language:`plain`,label:`Mapping file (YAML)`,viewRef:x,wrap:!0})})]}),(0,Q.jsxs)(`aside`,{className:`min-h-0 overflow-auto bg-canvas px-4 py-4`,"aria-label":`Mapping status`,children:[p===`example`&&(0,Q.jsxs)(`div`,{className:`mb-6`,"data-testid":`example-mapping`,children:[(0,Q.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Example mapping in use`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm`,children:`The search on the Translate page is a built-in example, and this mapping is empty, so the example mapping is used. Every name in it is made up. Your own searches need your own mapping.`}),(0,Q.jsxs)(`details`,{className:`mt-2 text-sm`,children:[(0,Q.jsx)(`summary`,{className:`cursor-pointer`,children:`Show the example mapping`}),(0,Q.jsx)(`pre`,{className:`code-block`,children:ae()}),(0,Q.jsx)(`p`,{className:`mt-1 text-xs text-muted`,children:`Plus the macros, extractions, eventtypes and tags of the sample app's .conf files.`})]})]}),(0,Q.jsx)(`h2`,{className:`text-sm font-semibold`,children:`Problems`}),S.length===0?(0,Q.jsxs)(`p`,{className:`mt-1 text-sm`,children:[(0,Q.jsxs)(`span`,{className:`mark-exact`,"aria-hidden":`true`,children:[`●`,` `]}),`The mapping file is valid.`]}):(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1 text-sm`,"data-testid":`mapping-issues`,children:e(S,i.list).map(e=>(0,Q.jsxs)(`li`,{children:[(0,Q.jsxs)(`span`,{className:`mark-error`,"aria-hidden":`true`,children:[`■`,` `]}),(0,Q.jsx)(`span`,{className:`font-code text-xs`,children:e.path||`/`}),` `,e.message]},`${e.path}-${e.message}`))}),(0,Q.jsx)(t,{total:S.length,limit:i.list,noun:`problems`,className:`mt-1`}),(0,Q.jsx)(`h2`,{className:`mt-6 text-sm font-semibold`,children:`Names the current search needs`}),w.length===0&&C.datamodels.length===0?(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-muted`,children:`Nothing is missing for the search on the Translate page.`}):w.map(n=>(0,Q.jsxs)(`div`,{className:`mt-3`,children:[(0,Q.jsx)(`h3`,{className:`text-xs font-semibold text-muted`,children:$[n]}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e(C[n],i.list).map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center gap-2 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-code`,children:e}),(0,Q.jsx)(`button`,{type:`button`,className:`control ml-auto`,onClick:()=>E(n,e),"aria-label":`Add ${e} to ${$[n]}`,children:`Add`})]},e))}),(0,Q.jsx)(t,{total:C[n].length,limit:i.list,noun:`names`,className:`mt-1`})]},n)),C.datamodels.length>0&&(0,Q.jsxs)(`div`,{className:`mt-3`,children:[(0,Q.jsx)(`h3`,{className:`text-xs font-semibold text-muted`,children:`Data models`}),(0,Q.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e(C.datamodels,i.list).map(e=>(0,Q.jsxs)(`li`,{className:`flex items-center gap-2 text-sm`,children:[(0,Q.jsx)(`span`,{className:`font-code`,children:e.name}),(0,Q.jsxs)(`span`,{className:`text-xs text-muted`,children:[e.fields.length,` field`,e.fields.length===1?``:`s`]}),(0,Q.jsx)(`button`,{type:`button`,className:`control ml-auto`,onClick:()=>T(ee(e.name,e.fields)),"aria-label":`Add ${e.name} to Data models`,children:`Add`})]},e.name))}),(0,Q.jsx)(t,{total:C.datamodels.length,limit:i.list,noun:`data models`,className:`mt-1`})]}),(0,Q.jsx)(`h2`,{className:`mt-6 text-sm font-semibold`,children:`From Splunk configuration files`}),(0,Q.jsxs)(`div`,{className:`mt-2`,children:[(0,Q.jsx)(f,{title:`Drop macros.conf, props.conf …`,compact:!0,children:(0,Q.jsx)(`p`,{children:`Macros, field extractions (EXTRACT and REPORT), eventtypes and tags are read from macros.conf, props.conf, transforms.conf, eventtypes.conf and tags.conf and added to the mapping. An entry the mapping already has is kept.`})}),(0,Q.jsx)(u,{here:`mapping`})]})]})]})}export{oe as MappingView};
|