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

web-interface.assets.1255d548-7375.0a62991cf0672754286c.js Maven / Gradle / Ivy

There is a newer version: 6.1.4
Show newest version
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["1255d548-7375"],{IoWmmmFK:(J,O,s)=>{s.d(O,{Z:()=>se});var n=s("Z7aTuO5B"),d=s("ii0bleBb"),e=s.n(d),I=s("VPaD/Np4"),p=s("S6FuRS7B"),a=s("/GOzvPf6"),c=s("uZqmR+ju"),b=s("+qc3iAHh"),E=s("8fnsnG21"),M=s("053yNwrM"),Z=s("RCNj0OY4"),g=s("JnTtTRmZ"),i=s.n(g),v=s("U1Iufsob"),D=s("eFxcQyPT"),R=s("MdYBRjRJ"),B=s("jAGDuYSC"),W=s("IA3Ku5lS");const _=(0,W.ei)("core.CodecTypes",()=>i().createActions({list:{asyncResult:!0}})),ee=(0,W.dS)("core.CodecTypes",()=>i().createStore({listenables:[_],codecTypes:void 0,getInitialState(){return{codecTypes:this.codecTypes}},list(){const f=(0,D.ZP)("GET",R.DC(v.Z.CodecTypesController.list().url));f.then(h=>{this.codecTypes=h,this.trigger(this.getInitialState())},h=>{B.Z.error(`Fetching codec types failed with status: ${h}`,"Could not retrieve codec types")}),_.list.promise(f)}}));var U=s("yEuO7gC5"),te=s("eOHTbxJi"),ae=s("/7OuCFNo");const V="127.0.0.1",X=({inputs:f,selectedInputId:h,onInputSelect:S})=>{const N=()=>{if(!f)return[{value:"none",label:"Loading inputs...",disabled:!0}];if(f.size===0)return[{value:"none",label:"No inputs available"}];const F=[];return f.sort((C,A)=>C.title.toLowerCase().localeCompare(A.title.toLowerCase())).forEach((C,A)=>{const w=`${A} / ${C.title} / ${C.name}`;F.push({value:A,label:w})}),F};return n.createElement(c.Input,{id:"inputSelect",name:"inputSelect",label:n.createElement(n.Fragment,null,"Message input ",n.createElement("small",null,"(optional)")),help:"Select the message input ID that should be assigned to the parsed message."},n.createElement(a.Ph,{inputId:"inputSelect",name:"inputSelect","aria-label":"Message input",placeholder:"Select input",options:N(),matchProp:"label",onChange:S,value:h}))},K=({onInputSelect:f})=>{const{ForwarderInputDropdown:h}=(0,M.Z)();return n.createElement(n.Fragment,null,n.createElement(h,{onLoadMessage:f,label:"Forwarder Input selection (optional)",autoLoadMessage:!0}),n.createElement("p",{className:"description"},"Select an Input profile from the list below then select an then select an Input."))},z=({inputs:f,selectedInputId:h,onInputSelect:S,show:N})=>{const{ForwarderInputDropdown:F}=(0,M.Z)(),[C,A]=(0,n.useState)();return N?Z.Z.isCloud()?n.createElement(K,{onInputSelect:S}):F?n.createElement("fieldset",null,n.createElement("legend",null,"Input selection (optional)"),n.createElement(c.Input,{id:"inputTypeSelect",type:"select",label:"Select an Input type (optional)",help:"Select the Input type you want to load the message from.",value:C!=null?C:"placeholder",onChange:w=>A(w.target.value)},n.createElement("option",{value:"placeholder",disabled:!0},"Select an Input type"),n.createElement("option",{value:"server"},"Server Input"),n.createElement("option",{value:"forwarder"},"Forwarder Input")),C==="server"&&n.createElement(X,{inputs:f,selectedInputId:h,onInputSelect:S}),C==="forwarder"&&n.createElement(K,{onInputSelect:S})):n.createElement(X,{inputs:f,selectedInputId:h,onInputSelect:S}):null},G=({onMessageLoaded:f,inputIdSelector:h,codecTypes:S,inputs:N})=>{const[F,C]=(0,n.useState)(!1),[A,w]=(0,n.useState)(""),[Y,j]=(0,n.useState)(V),[L,oe]=(0,n.useState)(""),[l,t]=(0,n.useState)({}),[o,r]=(0,n.useState)(),y=(0,ae.Z)();(0,n.useEffect)(()=>{_.list()},[]),(0,n.useEffect)(()=>{h&&U.x.list()},[h]);const P=m=>{m.preventDefault(),C(!0);const u=te.q.loadRawMessage(A,Y,L,l);u.then(T=>{f(T,{message:A,remoteAddress:Y,codec:L,codecConfiguration:l,inputId:o})}),u.finally(()=>C(!1))},x=()=>{if(!S)return[{value:"none",label:"Loading codec types...",disabled:!0}];const m=Object.keys(S);return m.length===0?[{value:"none",label:"No codecs available"}]:m.filter(u=>u!=="random-http-msg").map(u=>{const{name:T}=S[u];return{value:u,label:T===""?u:T}}).sort((u,T)=>u.label.toLowerCase().localeCompare(T.label.toLowerCase()))},q=m=>{oe(m),t({})},H=m=>{r(m)},ne=m=>{w((0,p.n6)(m.target))},re=m=>{j((0,p.n6)(m.target))},$=(m,u)=>{const T={...l,[m]:u};t(T)},ie=(m,u)=>{const T=l[m],Q="RawMessageLoader",k=`${Q}-${m}`;switch(u.type){case"text":return n.createElement(b.nv,{key:k,typeName:Q,title:m,field:u,value:T,onChange:$});case"number":return n.createElement(b.Ki,{key:k,typeName:Q,title:m,field:u,value:T,onChange:$});case"boolean":return n.createElement(b.Ig,{key:k,typeName:Q,title:m,field:u,value:T,onChange:$});case"dropdown":return n.createElement(b.Hi,{key:k,typeName:Q,title:m,field:u,value:T,onChange:$});default:return null}},de=!A||!L||F;let le;if(S&&L){const m=S[L].requested_configuration;le=Object.keys(m).sort((u,T)=>m[u].is_optional-m[T].is_optional).map(u=>ie(u,m[u]))}return n.createElement(c.Row,null,n.createElement(c.Col,{md:7},n.createElement("form",{onSubmit:P},n.createElement("fieldset",null,n.createElement(c.Input,{id:"message",name:"message",type:"textarea",label:"Raw message",value:A,onChange:ne,rows:3,required:!0}),n.createElement(c.Input,{id:"remoteAddress",name:"remoteAddress",type:"text",label:n.createElement("span",null,"Source IP address ",n.createElement("small",null,"(optional)")),help:`Remote IP address to use as message source. Graylog will use ${V} by default.`,value:Y,onChange:re})),n.createElement(z,{inputs:N,selectedInputId:o,onInputSelect:H,show:h}),n.createElement("fieldset",null,n.createElement("legend",null,"Codec configuration"),n.createElement(c.Input,{id:"codec",name:"codec",label:"Message codec",help:"Select the codec that should be used to decode the message.",required:!0},n.createElement(a.Ph,{id:"codec","aria-label":"Message codec",placeholder:"Select codec",options:x(),matchProp:"label",onChange:q,value:L})),le),n.createElement(a.Ow,{submitButtonText:"Load message",submitLoadingText:"Loading message...",isSubmitting:F,isAsyncSubmit:!0,disabledSubmit:de,onCancel:()=>y.goBack()}))))};G.propTypes={onMessageLoaded:e().func.isRequired,inputIdSelector:e().bool,codecTypes:e().object,inputs:e().object},G.defaultProps={inputIdSelector:!1,codecTypes:void 0,inputs:void 0};const se=(0,E.Z)(G,{inputs:U.Q,codecTypes:ee},({inputs:{inputs:f},codecTypes:{codecTypes:h}})=>({inputs:f?I.Map(U.Q.inputsAsMap(f)):void 0,codecTypes:h}))},"053yNwrM":(J,O,s)=>{s.d(O,{Z:()=>e});var n=s("QL8i6bcz");const e=()=>{var I,p;return((p=(I=n.G.exports("forwarder"))==null?void 0:I[0])==null?void 0:p.messageLoaders)||{ForwarderInputDropdown:void 0}}},"8/L0uEJc":(J,O,s)=>{s.d(O,{Z:()=>Z});var n=s("ii0bleBb"),d=s.n(n),e=s("Z7aTuO5B"),I=s("ty2gyrHp"),p=s("uZqmR+ju"),a=s("xS8q27Jr"),c=Object.defineProperty,b=(g,i,v)=>i in g?c(g,i,{enumerable:!0,configurable:!0,writable:!0,value:v}):g[i]=v,E=(g,i,v)=>(b(g,typeof i!="symbol"?i+"":i,v),v);class M extends e.Component{constructor(){super(...arguments),E(this,"_refreshExtractorRoutes",i=>{this.newExtractorRoutes=a.Z.getNewExtractorRoutes(i.message.source_node_id,i.message.source_input_id,i.fieldName,i.message.index,i.message.id)}),E(this,"_formatExtractorMenuItem",i=>e.createElement(I.J,{key:`menu-item-${i}`,to:this.newExtractorRoutes[i]},e.createElement(p.MenuItem,null,a.Z.getReadableExtractorTypeName(i))))}UNSAFE_componentWillMount(){this._refreshExtractorRoutes(this.props)}UNSAFE_componentWillReceiveProps(i){this._refreshExtractorRoutes(i)}render(){const{fieldName:i,message:v}=this.props;return typeof v.fields[i]=="string"?e.createElement("div",{className:"message-field-actions pull-right"},e.createElement(p.DropdownButton,{pullRight:!0,bsSize:"xsmall",title:"Select extractor type",key:1,id:`select-extractor-type-dropdown-field-${i}`},a.Z.EXTRACTOR_TYPES.map(R=>this._formatExtractorMenuItem(R)))):e.createElement("div",{className:"message-field-actions pull-right"},e.createElement(p.DropdownButton,{pullRight:!0,bsSize:"xsmall",title:"Select extractor type",key:1,id:`select-extractor-type-dropdown-field-${i}`},e.createElement(p.MenuItem,{key:"select-extractor-type-disabled",disabled:!0},"Extractors can only be used with string fields.")))}}E(M,"propTypes",{fieldName:d().string.isRequired,message:d().object.isRequired});const Z=M},wzrLaWZc:(J,O,s)=>{s.d(O,{Z:()=>oe});var n=s("ii0bleBb"),d=s.n(n),e=s("Z7aTuO5B"),I=s("VPaD/Np4"),p=s.n(I),a=s("uZqmR+ju"),c=s("TJOheZRu"),b=s("ty2gyrHp"),E=s("/GOzvPf6"),M=s("Wh5iba66"),Z=s("J6y4/h8P"),g=s("nxMFMmDQ"),i=Object.defineProperty,v=(l,t,o)=>t in l?i(l,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):l[t]=o,D=(l,t,o)=>(v(l,typeof t!="symbol"?t+"":t,o),o);const R=Z.default.span(({theme:l})=>(0,Z.css)`
  margin-right: 8px;
  font-family: ${l.fonts.family.monospace};
`);class B extends e.Component{constructor(t){super(t),D(this,"_shouldShowTerms",()=>{const{messageTerms:o}=this.state;return o.size!==0}),D(this,"_getFormattedTerms",()=>{const{messageTerms:o}=this.state;return o.map(r=>e.createElement(R,{key:r},r))}),D(this,"_getFormattedFieldActions",()=>{const{customFieldActions:o,fieldName:r,message:y}=this.props;return o?e.cloneElement(o,{fieldName:r,message:y}):null}),this.state={messageTerms:p().List()}}render(){const{fieldName:t,renderForDisplay:o}=this.props,r=t===g.ZA||t===g.TI?"message-field":"";return e.createElement("dd",{className:r,key:`${t}dd`},this._getFormattedFieldActions(),e.createElement("div",{className:"field-value"},o(t)),this._shouldShowTerms()&&e.createElement(a.Alert,{bsStyle:"info",onDismiss:()=>this.setState({messageTerms:p().Map()})},"Field terms: \xA0",this._getFormattedTerms()))}}D(B,"propTypes",{message:d().object.isRequired,fieldName:d().string.isRequired,renderForDisplay:d().func.isRequired,customFieldActions:d().node}),D(B,"defaultProps",{customFieldActions:void 0});const W=B;var _=s("8/L0uEJc");const ee=[g.TI,"level"],U=({message:l,value:t,fieldName:o,customFieldActions:r,renderForDisplay:y})=>{const P=ee.indexOf(o)!==-1?l.fields[o]:t;return e.createElement("span",null,e.createElement("dt",{key:`${o}Title`},o),e.createElement(W,{key:`${o}Description`,message:l,fieldName:o,fieldValue:P,renderForDisplay:y,customFieldActions:r}))};U.propTypes={customFieldActions:d().node,fieldName:d().string.isRequired,message:d().object.isRequired,renderForDisplay:d().func.isRequired,value:d().any.isRequired},U.defaultProps={customFieldActions:void 0};const te=U;var ae=s("E9JT2cEW"),V=Object.defineProperty,X=(l,t,o)=>t in l?V(l,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):l[t]=o,K=(l,t,o)=>(X(l,typeof t!="symbol"?t+"":t,o),o);class z extends e.Component{constructor(){super(...arguments),K(this,"_formatFields",t=>Object.keys(t).sort().map(o=>e.createElement(te,{key:o,...this.props,fieldName:o,value:t[o]})))}render(){const{message:t}=this.props,{_id:o,...r}=t.fields,y=t.formatted_fields||r,P=this._formatFields(y);return e.createElement(E.pb,{className:"message-details-fields"},P)}}K(z,"propTypes",{customFieldActions:d().node,message:d().object.isRequired,renderForDisplay:d().func.isRequired}),K(z,"defaultProps",{customFieldActions:void 0});const G=z;var se=s("Y2DdPzXi"),f=s("d4kzUuQm"),h=s("RCNj0OY4"),S=Object.defineProperty,N=(l,t,o)=>t in l?S(l,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):l[t]=o,F=(l,t,o)=>(N(l,typeof t!="symbol"?t+"":t,o),o);class C extends e.Component{constructor(){super(...arguments),F(this,"_inputName",t=>{const{inputs:o}=this.props,r=o.get(t);return r?e.createElement("span",{style:{wordBreak:"break-word"}},r.title):"deleted input"}),F(this,"_nodeName",t=>{const{nodes:o}=this.props,r=o.get(t);let y;if(r){const P=f.ZP.node(t),x=e.createElement(e.Fragment,null,e.createElement(E.JO,{name:"code-branch"}),"\xA0",e.createElement("span",{style:{wordBreak:"break-word"}},r.short_node_id),"\xA0/\xA0",e.createElement("span",{style:{wordBreak:"break-word"}},r.hostname));y=h.Z.isCloud()?x:e.createElement("a",{href:P},x)}else y=e.createElement("span",{style:{wordBreak:"break-word"}},"stopped node");return y}),F(this,"_formatMessageActions",()=>{const{message:t,customFieldActions:o}=this.props;if(!o)return e.createElement(a.ButtonGroup,{className:"pull-right",bsSize:"small"});const r=t.index?f.ZP.message_show(t.index,t.id):"#";return e.createElement(a.ButtonGroup,{className:"pull-right",bsSize:"small"},e.createElement(a.Button,{href:r},"Permalink"),e.createElement(E.mU,{title:"Copy ID",bsSize:"small",text:t.id}))}),F(this,"_getStreamLinks",t=>{const{streams:o,message:r}=this.props;return r.streams?r.streams.map(P=>e.createElement("li",{key:P.id},e.createElement(M.Z,{stream:P}))):t.map(P=>{const x=o.get(P);return x!==void 0?e.createElement("li",{key:x.id},e.createElement(M.Z,{stream:x})):null})})}render(){const{renderForDisplay:t,nodes:o,message:r,customFieldActions:y}=this.props,P=p().Set(r.stream_ids),x=this._getStreamLinks(P),q=r.source_radio_id?e.createElement("span",null,"via ",e.createElement("em",null,this._inputName(r.source_radio_input_id))," on radio ",this._nodeName(r.source_radio_id)):null,H=r.fields.timestamp,ne=[e.createElement("dt",{key:`dt-${H}`},"Timestamp"),e.createElement("dd",{key:`dd-${H}`},e.createElement(E.EK,{dateTime:H}))],re=r.source_input_id&&r.source_node_id&&o?e.createElement("div",null,e.createElement("dt",null,"Received by"),e.createElement("dd",null,e.createElement("em",null,this._inputName(r.source_input_id))," ","on ",this._nodeName(r.source_node_id),q&&e.createElement("br",null),q)):null,$=r.index?e.createElement(b.r,{to:f.ZP.message_show(r.index,r.id)},r.id):e.createElement("span",null,r.id," ",e.createElement(a.Label,{bsStyle:"warning"},"Not stored"));return e.createElement("div",null,e.createElement(a.Row,{className:"row-sm"},e.createElement(a.Col,{md:12},this._formatMessageActions(),e.createElement(se.Z,null,e.createElement(E.JO,{name:"envelope"}),"\xA0",$))),e.createElement(a.Row,null,e.createElement(a.Col,{md:3},e.createElement(E.pb,null,ne,re,e.createElement("dt",null,"Stored in index"),e.createElement("dd",null,r.index?r.index:"Message is not stored"),P.size>0&&e.createElement("dt",null,"Routed into streams"),P.size>0&&e.createElement("dd",{className:"stream-list"},e.createElement("ul",null,x)))),e.createElement(a.Col,{md:9},e.createElement("div",null,e.createElement(G,{message:r,renderForDisplay:t,customFieldActions:y})))))}}F(C,"propTypes",{renderForDisplay:d().func.isRequired,inputs:d().object,nodes:d().object,message:d().object.isRequired,streams:d().object,customFieldActions:d().node}),F(C,"defaultProps",{inputs:void 0,nodes:void 0,streams:void 0,customFieldActions:void 0});const A=C;var w=Object.defineProperty,Y=(l,t,o)=>t in l?w(l,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):l[t]=o,j=(l,t,o)=>(Y(l,typeof t!="symbol"?t+"":t,o),o);class L extends e.Component{constructor(t){super(t),j(this,"_getImmutableProps",o=>({streams:o.streams?p().Map(o.streams):o.streams,nodes:o.nodes?p().Map(o.nodes):o.nodes})),j(this,"renderForDisplay",o=>{const{message:r}=this.props;return c.Z.stringify(r.fields[o])}),this.state=this._getImmutableProps(t)}UNSAFE_componentWillReceiveProps(t){this.setState(this._getImmutableProps(t))}render(){const{inputs:t,message:o}=this.props,{streams:r,nodes:y}=this.state;return e.createElement(a.Row,{className:"content"},e.createElement(a.Col,{md:12},e.createElement(A,{...this.props,message:o,inputs:t,streams:r,nodes:y,renderForDisplay:this.renderForDisplay,showTimestamp:!0})))}}j(L,"propTypes",{message:d().object.isRequired,inputs:d().object,streams:d().object,nodes:d().object}),j(L,"defaultProps",{inputs:void 0,nodes:void 0,streams:void 0});const oe=L},mr1MxJ4D:(J,O,s)=>{s.d(O,{Z:()=>p});var n=s("9oVghaOd"),d=s.n(n),e=s("0+7ljD5O");const p={formatMessageSummary(a){const{message:c}=a;return this.formatMessage(c._id,a.index,c,c,a.highlight_ranges,a.decoration_stats)},formatResultMessage(a){const{message:c}=a;return this.formatMessage(c.id,a.index,c,c.fields,a.highlight_ranges,a.decoration_stats)},formatMessage(a,c,b,E,M,Z){const g=e.Z.filterFields(E);return{id:a,timestamp:d()(b.timestamp).unix(),filtered_fields:g,formatted_fields:g,fields:E,index:c,source_node_id:E.gl2_source_node,source_input_id:E.gl2_source_input,stream_ids:b.streams,highlight_ranges:M,decoration_stats:Z}}}},eOHTbxJi:(J,O,s)=>{s.d(O,{q:()=>M});var n=s("JnTtTRmZ"),d=s.n(n),e=s("eFxcQyPT"),I=s("mr1MxJ4D"),p=s("U1Iufsob"),a=s("MdYBRjRJ"),c=s("jAGDuYSC"),b=s("TJOheZRu"),E=s("IA3Ku5lS");const M=(0,E.ei)("core.Messages",()=>d().createActions({loadMessage:{asyncResult:!0},fieldTerms:{asyncResult:!0},loadRawMessage:{asyncResult:!0}})),Z=(0,E.dS)("core.Messages",()=>d().createStore({listenables:[M],sourceUrl:"",getInitialState(){return{}},loadMessage(g,i){const{url:v}=p.Z.MessagesController.single(g.trim(),i.trim()),D=(0,e.ZP)("GET",a.DC(v)).then(R=>I.Z.formatResultMessage(R),R=>{c.Z.error(`Loading message information failed with status: ${R}`,"Could not load message information")});M.loadMessage.promise(D)},fieldTerms(g,i){const{url:v}=p.Z.MessagesController.analyze(g,encodeURIComponent(b.Z.stringify(i))),D=(0,e.ZP)("GET",a.DC(v)).then(R=>R.tokens,R=>{c.Z.error(`Loading field terms failed with status: ${R}`,"Could not load field terms.")});M.fieldTerms.promise(D)},loadRawMessage(g,i,v,D){const{url:R}=p.Z.MessagesController.parse(),B={message:g,remote_address:i,codec:v,configuration:D},W=(0,e.ZP)("POST",a.DC(R),B).then(_=>I.Z.formatResultMessage(_),_=>{if(_.additional&&_.additional.status===400){c.Z.error("Please ensure the selected codec and its configuration are right. Check your server logs for more information.","Could not load raw message");return}c.Z.error(`Loading raw message failed with status: ${_}`,"Could not load raw message")});M.loadRawMessage.promise(W)}}))}}]);})();

//# sourceMappingURL=1255d548-7375.0a62991cf0672754286c.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy