All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.325e2d4b-9101.dae10bdcab426bb7880d.js Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
"use strict";(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["325e2d4b-9101"],{pLLmkYy5:(e,t,s)=>{s.d(t,{Z:()=>c});var n=s("Z7aTuO5B"),a=s("J6y4/h8P"),l=s("F9olzlTR"),r=s("EeAwn/0x"),i=s("0zTRKSqx"),o=s("XR6lEGGZ");const m=(0,a.default)(l.Si).withConfig({displayName:"PageNavigation__Container",componentId:"sc-1if5i40-0"})(["margin-bottom:10px;"]),u=(0,a.default)(l.zx).withConfig({displayName:"PageNavigation__StyledButton",componentId:"sc-1if5i40-1"})((e=>{let{theme:t}=e;return(0,a.css)(["font-family:",";font-size:",";&&&&{color:",";:hover,:focus{text-decoration:none;}:hover{","}&.active{color:",";"," :hover,:focus{","}}}"],t.fonts.family.navigation,t.fonts.size.navigation,t.colors.variant.darker.default,(0,o.RF)(t),t.colors.global.textDefault,(0,o.A7)(t),(0,o.A7)(t))}));u.displayName="Button";const c=e=>{let{items:t}=e;return n.createElement(m,null,t.map((e=>{let{path:t,title:s,permissions:a,exactPathMatch:l}=e;return t?n.createElement(i.AE,{permissions:null!=a?a:[],key:t},n.createElement(r.J,{to:t,relativeActive:!l},n.createElement(u,{bsStyle:"link"},n.createElement(o.ZP,null,s)))):null})))}},MOgDWHS8:(e,t,s)=>{s.d(t,{Z:()=>o});var n=s("Z7aTuO5B"),a=s("pLLmkYy5"),l=s("DeVaSktS"),r=s("F9olzlTR");const i=[{title:"Manage pipelines",path:l.ZP.SYSTEM.PIPELINES.OVERVIEW,exactPathMatch:!0},{title:"Manage rules",path:l.ZP.SYSTEM.PIPELINES.RULES},{title:"Simulator",path:l.ZP.SYSTEM.PIPELINES.SIMULATOR}],o=()=>n.createElement(r.X2,null,n.createElement(a.Z,{items:i}))},IteCVdHd:(e,t,s)=>{s.r(t),s.d(t,{default:()=>Ee});var n=s("Z7aTuO5B"),a=s("F9olzlTR"),l=s("0zTRKSqx"),r=s("ii0bleBb"),i=s.n(r),o=s("6n4dw8v3"),m=s("EeAwn/0x"),u=s("uyiSze+5"),c=s("DeVaSktS"),d=s("JnTtTRmZ"),p=s.n(d),g=s("0wQfx7YJ"),h=s("rkoyttmq"),E=s("OqsMdpSm"),f=s("Dz3KvXEI"),S=s("+g3JwX3k"),v=s("xc00RsLr");const A=(0,v.ei)("core.Simulator",(()=>p().createActions({simulate:{asyncResult:!0}})));(0,v.dS)("core.Simulator",(()=>p().createStore({listenables:[A],simulate(e,t,s){const n=g.DC(h.Z.SimulatorController.simulate().url),a={stream_id:e.id,message:t,input_id:s};let l=(0,E.ZP)("POST",n,a);l=l.then((e=>{const t=S.Z.clone(e);return t.messages=e.messages.map((e=>f.Z.formatMessageSummary(e))),t})),A.simulate.promise(l)}})));var b=s("CUoHsH59"),_=s("ApyIyvbD"),w=s("J6y4/h8P"),y=s("D4SbLiE/"),I=s.n(y);const M=w.default.div.withConfig({displayName:"SimulationChanges__SimulationChangesWrap",componentId:"sc-8913kw-0"})(['padding-top:15px;dl{margin-bottom:10px;margin-top:5px;}dd{padding:1px 9px 3px;}dt{margin-top:1px;padding:3px 9px 1px;&::after{content:": ";}&:first-child{border-radius:4px 4px 0 0;}~ dd:last-child{border-radius:0 0 4px 4px;}}']),R=w.default.div.withConfig({displayName:"SimulationChanges__OriginalChanges",componentId:"sc-8913kw-1"})(["margin-top:10px;"]),C=w.default.div.withConfig({displayName:"SimulationChanges__FieldResultWrap",componentId:"sc-8913kw-2"})((e=>{let{resultType:t,theme:s}=e;const{success:n,danger:a,info:l}=s.colors.variant.light,r={added:n,removed:a,mutated:l};return`\n    dt,\n    dd {\n      background-color: ${r[t]};\n      color: ${s.utils.contrastingColor(r[t])};\n    }\n  `})),T=w.default.dd.withConfig({displayName:"SimulationChanges__FieldValue",componentId:"sc-8913kw-3"})((e=>{let{removed:t,theme:s}=e;return(0,w.css)(["font-family:",";",""],s.fonts.family.monospace,t&&(0,w.css)(["text-decoration:line-through;font-style:italic;"]))})),O=I()({displayName:"SimulationChanges",propTypes:{originalMessage:i().object.isRequired,simulationResults:i().object.isRequired},_isOriginalMessageRemoved:(e,t)=>!t.find((t=>t.id===e.id)),_formatFieldTitle:e=>n.createElement("dt",{key:`${e}-key`},e),_formatFieldValue(e,t){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n.createElement(T,{key:`${e}-value`,removed:s},String(t))},_formatAddedFields(e){const t=Object.keys(e);if(0===t.length)return null;const s=[];return t.sort().forEach((t=>{s.push(this._formatFieldTitle(t)),s.push(this._formatFieldValue(t,e[t]))})),n.createElement(C,{resultType:"added"},n.createElement("h4",null,"Added fields"),n.createElement("dl",null,s))},_formatRemovedFields(e){const t=Object.keys(e);if(0===t.length)return null;const s=[];return t.sort().forEach((t=>{s.push(this._formatFieldTitle(t)),s.push(this._formatFieldValue(t,e[t]))})),n.createElement(C,{resultType:"removed"},n.createElement("h4",null,"Removed fields"),n.createElement("dl",null,s))},_formatMutatedFields(e){const t=Object.keys(e);if(0===t.length)return null;const s=[];return t.sort().forEach((t=>{s.push(this._formatFieldTitle(t)),s.push(this._formatFieldValue(`${t}-original`,e[t].before,!0)),s.push(this._formatFieldValue(t,e[t].after))})),n.createElement(C,{resultType:"mutated"},n.createElement("h4",null,"Mutated fields"),n.createElement("dl",null,s))},_getOriginalMessageChanges(){const{originalMessage:e,simulationResults:t}=this.props,s=t.messages;if(this._isOriginalMessageRemoved(e,s))return n.createElement("p",null,"Original message would be dropped during processing.");const a=s.find((t=>t.id===e.id)),l=this._formatAddedFields(a.decoration_stats.added_fields),r=this._formatRemovedFields(a.decoration_stats.removed_fields),i=this._formatMutatedFields(a.decoration_stats.changed_fields);return l||r||i?n.createElement(R,null,l,r,i):n.createElement("p",null,"Original message would be not be modified during processing.")},_formatOriginalMessageChanges(){const{originalMessage:e}=this.props;return n.createElement(a.X2,{className:"row-sm"},n.createElement(a.JX,{md:12},n.createElement("h3",null,"Changes in original message"," ",n.createElement("small",null,n.createElement("em",null,e.id))),this._getOriginalMessageChanges()))},_formatOtherChanges(){const{originalMessage:e,simulationResults:t}=this.props,s=t.messages.filter((t=>t.id!==e.id));return 0===s.length?null:n.createElement(a.X2,{className:"row-sm"},n.createElement(a.JX,{md:12},n.createElement("h3",null,"Other changes"),n.createElement("p",null,"There would be ",s.length," ",n.createElement(l.qX,{singular:"message",plural:"messages",value:s.length})," created."," ","Switch to the ",n.createElement("em",null,"Results preview")," view option to see"," ",n.createElement(l.qX,{singular:"it",plural:"them",value:s.length}),".")))},render(){return n.createElement(M,null,this._formatOriginalMessageChanges(),this._formatOtherChanges())}}),x=e=>{let{simulationResults:t,streams:s}=e;const{messages:l}=t;if(0===l.length)return n.createElement(a.bZ,{bsStyle:"info"},n.createElement("p",null,n.createElement("strong",null,"Message would be dropped")),n.createElement("p",null,"The pipeline processor would drop such a message. That means that the message",n.createElement("strong",null,"would not be stored"),", and would not be available for searches, alerts, outputs, or dashboards."));const r=l.map((e=>n.createElement(b.Z,{key:e.id,message:e,streams:s})));return n.createElement("div",{className:"message-preview-wrapper"},r)};x.propTypes={simulationResults:i().object.isRequired,streams:i().object.isRequired};const P=x;var k=s("dFpwyWHg"),L=s.n(k),N=s("C2ikvoS0"),Z=s.n(N),F=s("1IntWRSu"),B=s.n(F),X=s("8nGWeFnd"),j=s.n(X),V=s("TeAcaicX"),U=s.n(V),J=s("eE3+5goe"),W=s.n(J),D=s("rtRO5KL4"),q={};D.Z&&D.Z.locals&&(q.locals=D.Z.locals);var z,Y=0,K={};K.styleTagTransform=W(),K.setAttributes=j(),K.insert=B().bind(null,"head"),K.domAPI=Z(),K.insertStyleElement=U(),q.use=function(e){return K.options=e||{},Y++||(z=L()(D.Z,K)),q},q.unuse=function(){Y>0&&!--Y&&(z(),z=null)};const G=q,H=I()({displayName:"SimulationTrace",propTypes:{simulationResults:i().object.isRequired},componentDidMount(){G.use()},componentWillUnmount(){G.unuse()},render(){const{simulationResults:e}=this.props,t=e.simulation_trace,s=[];return t.forEach(((e,t)=>{s.push(n.createElement("dt",{key:`${e.time}-${t}-title`},_.Z.formatNumber(e.time)," μs")),s.push(n.createElement("dd",{key:`${e}-${t}-description`},n.createElement("span",null,e.message)))})),n.createElement("dl",{className:"dl-horizontal dl-simulation-trace"},s)}});var Q=s("jLmTPYKW"),ee={};Q.Z&&Q.Z.locals&&(ee.locals=Q.Z.locals);var te,se=0,ne={};ne.styleTagTransform=W(),ne.setAttributes=j(),ne.insert=B().bind(null,"head"),ne.domAPI=Z(),ne.insertStyleElement=U(),ee.use=function(e){return ne.options=e||{},se++||(te=L()(Q.Z,ne)),ee},ee.unuse=function(){se>0&&!--se&&(te(),te=null)};const ae=ee;function le(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}const re={SIMULATION_PREVIEW:1,SIMULATION_SUMMARY:2,SIMULATION_TRACE:3};class ie extends n.Component{constructor(e){super(e),le(this,"_changeViewOptions",(e=>{const t=Object.keys(re).find((t=>re[t]===e));this.setState({viewOption:re[t]})})),le(this,"_getViewOptionsMenuItems",(()=>[this._getViewOptionsMenuItem(re.SIMULATION_SUMMARY,"Changes summary"),this._getViewOptionsMenuItem(re.SIMULATION_PREVIEW,"Results preview"),this._getViewOptionsMenuItem(re.SIMULATION_TRACE,"Simulation trace")])),le(this,"_getViewOptionsMenuItem",((e,t)=>{const{viewOption:s}=this.state;return n.createElement(a.sN,{key:e,eventKey:e,active:s===e},t)})),le(this,"_getViewComponent",(e=>{const{simulationResults:t,isLoading:s,originalMessage:a}=this.props;if(s||!t)return n.createElement(l.$j,null);const{viewOption:r}=this.state;switch(r){case re.SIMULATION_PREVIEW:return n.createElement(P,{simulationResults:t,streams:e});case re.SIMULATION_SUMMARY:return n.createElement(O,{originalMessage:a,simulationResults:t});case re.SIMULATION_TRACE:return n.createElement(H,{simulationResults:t})}return null})),this.state={viewOption:re.SIMULATION_SUMMARY}}componentDidMount(){ae.use()}componentWillUnmount(){ae.unuse()}render(){const{stream:e,simulationResults:t,isLoading:s,error:r,originalMessage:i}=this.props;if(!i&&!t)return null;const o={[e.id]:e},m=s?n.createElement(l.$j,null):i?n.createElement(b.Z,{message:i,streams:o}):null,u=r?n.createElement(a.bZ,{bsStyle:"danger"},n.createElement("p",null,n.createElement("strong",null,"Error simulating message processing")),n.createElement("p",null,"Could not simulate processing of message ",n.createElement("em",null,i.id)," in stream"," ",n.createElement("em",null,e.title),".",n.createElement("br",null),"Please try loading the message again, or use another message for the simulation.")):null;return n.createElement(a.X2,null,n.createElement(a.JX,{md:12},n.createElement("hr",null)),n.createElement(a.JX,{md:6},n.createElement("h1",null,"Original message"),n.createElement("p",null,"This is the original message loaded from Graylog."),n.createElement("div",{className:"message-preview-wrapper"},m)),n.createElement(a.JX,{md:6},n.createElement("div",{className:"pull-right"},n.createElement(a.PS,{id:"simulation-view-options",title:"More results",onSelect:this._changeViewOptions,bsStyle:"default",bsSize:"small",pullRight:!0},this._getViewOptionsMenuItems())),n.createElement("h1",null,"Simulation results"),n.createElement("p",null,s?"Simulating message processing, please wait a moment.":`These are the results of processing the loaded message. Processing took ${_.Z.formatNumber(null==t?void 0:t.took_microseconds)} µs.`),u,this._getViewComponent(o)))}}ie.propTypes={stream:i().object.isRequired,originalMessage:i().object,simulationResults:i().object,isLoading:i().bool,error:i().object},ie.defaultProps={originalMessage:void 0,simulationResults:void 0,isLoading:!1,error:void 0};const oe=ie;function me(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e}class ue extends n.Component{constructor(e){super(e),me(this,"_onMessageLoad",((e,t)=>{this.setState({message:e,simulation:void 0,loading:!0,error:void 0}),A.simulate.triggerPromise(this.state.stream,e.fields,t.inputId).then((e=>{this.setState({simulation:e,loading:!1})}),(e=>{this.setState({loading:!1,error:e})}))})),me(this,"_getFormattedStreams",(e=>e?e.map((e=>({value:e.id,label:e.title}))).sort(((e,t)=>(0,o.S)(e.label,t.label))):[])),me(this,"_onStreamSelect",(e=>{const t=this.props.streams.find((t=>t.id.toLowerCase()===e.toLowerCase()));this.setState({stream:t})})),this.defaultStream=e.streams.find((e=>"000000000000000000000001"===e.id))||e.streams[0],this.state={message:void 0,stream:this.defaultStream,simulation:void 0,loading:!1,error:void 0}}render(){if(0===this.props.streams.length)return n.createElement("div",null,n.createElement(a.X2,{className:"row-sm"},n.createElement(a.JX,{md:8,mdOffset:2},n.createElement(a.s_,{bsStyle:"danger",header:"No streams found"},"Pipelines operate on streams, but your system currently has no streams. Please"," ",n.createElement(m.r,{to:c.ZP.STREAMS},"create a stream")," ","and come back here later to test pipelines processing messages in your new stream."))));const e=n.createElement("span",null,"Select a stream to use during simulation, the ",n.createElement("em",null,this.defaultStream.title)," stream is used by default.");return n.createElement("div",null,n.createElement(a.X2,null,n.createElement(a.JX,{md:12},n.createElement("h1",null,"Load a message"),n.createElement("p",null,"Build an example message that will be used in the simulation."," ",n.createElement("strong",null,"No real messages stored in Graylog will be changed. All actions are purely simulated on the temporary input you provide below.")),n.createElement(a.X2,{className:"row-sm"},n.createElement(a.JX,{md:7},n.createElement(a.cw,{id:"streamSelectorSimulation"},n.createElement(a.J$,null,"Stream"),n.createElement(l.Ph,{options:this._getFormattedStreams(this.props.streams),onChange:this._onStreamSelect,value:this.state.stream.id,required:!0,clearable:!1}),n.createElement(a.Qb,null,e)))),n.createElement(u.Z,{onMessageLoaded:this._onMessageLoad,inputIdSelector:!0}))),n.createElement(oe,{stream:this.state.stream,originalMessage:this.state.message,simulationResults:this.state.simulation,isLoading:this.state.loading,error:this.state.error}))}}me(ue,"propTypes",{streams:i().array.isRequired});const ce=ue;var de=s("4Js8dUPg"),pe=s("xxwliabF"),ge=s("MOgDWHS8");class he extends n.Component{constructor(e){var t,s,n;super(e),n=()=>{const{streams:e}=this.state;return!e},(s="_isLoading")in(t=this)?Object.defineProperty(t,s,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[s]=n,this.state={streams:void 0}}componentDidMount(){pe.ZP.listStreams().then((e=>{const t=e.filter((e=>e.is_editable));this.setState({streams:t})}))}render(){const{streams:e}=this.state,t=this._isLoading()?n.createElement(l.$j,null):n.createElement(ce,{streams:e});return n.createElement(l.$4,{title:"Simulate processing"},n.createElement(ge.Z,null),n.createElement(l.mr,{title:"Simulate processing",documentationLink:{title:"Pipelines documentation",path:de.Z.PAGES.PIPELINE_RULES}},n.createElement("span",null,"Processing messages can be complex. Use this page to simulate the result of processing an incoming message using your current set of pipelines and rules.")),n.createElement(a.X2,{className:"content"},n.createElement(a.JX,{md:12},t)))}}const Ee=he},jLmTPYKW:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s("pmX897Fv"),a=s.n(n),l=s("DjJvgDaP"),r=s.n(l)()(a());r.push([e.id,".message-preview-wrapper {\n    margin-left: 15px;\n    margin-right: 15px;\n}\n\n.message-preview-wrapper dl {\n    margin-top: 5px;\n    margin-bottom: 0;\n}","",{version:3,sources:["webpack://./src/components/simulator/SimulationResults.lazy.css"],names:[],mappings:"AAAA;IACI,iBAAiB;IACjB,kBAAkB;AACtB;;AAEA;IACI,eAAe;IACf,gBAAgB;AACpB",sourcesContent:[".message-preview-wrapper {\n    margin-left: 15px;\n    margin-right: 15px;\n}\n\n.message-preview-wrapper dl {\n    margin-top: 5px;\n    margin-bottom: 0;\n}"],sourceRoot:""}]),r.locals={};const i=r},rtRO5KL4:(e,t,s)=>{s.d(t,{Z:()=>i});var n=s("pmX897Fv"),a=s.n(n),l=s("DjJvgDaP"),r=s.n(l)()(a());r.push([e.id,".dl-simulation-trace {\n    padding-top: 15px;\n}\n\n.dl-simulation-trace dt {\n    width: 80px;\n}\n\n.dl-simulation-trace dd {\n    margin-left: 100px;\n    margin-bottom: 5px;\n}\n","",{version:3,sources:["webpack://./src/components/simulator/SimulationTrace.lazy.css"],names:[],mappings:"AAAA;IACI,iBAAiB;AACrB;;AAEA;IACI,WAAW;AACf;;AAEA;IACI,kBAAkB;IAClB,kBAAkB;AACtB",sourcesContent:[".dl-simulation-trace {\n    padding-top: 15px;\n}\n\n.dl-simulation-trace dt {\n    width: 80px;\n}\n\n.dl-simulation-trace dd {\n    margin-left: 100px;\n    margin-bottom: 5px;\n}\n"],sourceRoot:""}]),r.locals={};const i=r}}]);
//# sourceMappingURL=325e2d4b-9101.dae10bdcab426bb7880d.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy