web-interface.assets.bb8c8232-4742.b7d2aac1c94609dffdc7.js Maven / Gradle / Ivy
"use strict";(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["bb8c8232-4742"],{IoWmmmFK:(J,O,s)=>{s.d(O,{A:()=>se});var r=s("Z7aTuO5B"),d=s("ii0bleBb"),e=s.n(d),b=s("VPaD/Np4"),p=s("S6FuRS7B"),a=s("IOI9nV80"),c=s("rIl5IEuP"),I=s("+qc3iAHh"),E=s("8fnsnG21"),M=s("053yNwrM"),B=s("RCNj0OY4"),g=s("JnTtTRmZ"),i=s.n(g),v=s("U1Iufsob"),T=s("eFxcQyPT"),R=s("MdYBRjRJ"),N=s("jAGDuYSC"),K=s("IA3Ku5lS");const _=(0,K.rN)("core.CodecTypes",()=>i().createActions({list:{asyncResult:!0}})),ee=(0,K.Bv)("core.CodecTypes",()=>i().createStore({listenables:[_],codecTypes:void 0,getInitialState(){return{codecTypes:this.codecTypes}},list(){const f=(0,T.Ay)("GET",R.H3(v.A.CodecTypesController.list().url));f.then(h=>{this.codecTypes=h,this.trigger(this.getInitialState())},h=>{N.A.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 Q="127.0.0.1",X=({inputs:f,selectedInputId:h,onInputSelect:D})=>{const w=()=>{if(!f)return[{value:"none",label:"Loading inputs...",disabled:!0}];if(f.size===0)return[{value:"none",label:"No inputs available"}];const S=[];return f.sort((A,F)=>A.title.toLowerCase().localeCompare(F.title.toLowerCase())).forEach((A,F)=>{const W=`${F} / ${A.title} / ${A.name}`;S.push({value:F,label:W})}),S};return r.createElement(c.Input,{id:"inputSelect",name:"inputSelect",label:r.createElement(r.Fragment,null,"Message input ",r.createElement("small",null,"(optional)")),help:"Select the message input ID that should be assigned to the parsed message."},r.createElement(a.l6,{inputId:"inputSelect",name:"inputSelect","aria-label":"Message input",placeholder:"Select input",options:w(),matchProp:"label",onChange:D,value:h}))},j=({onInputSelect:f})=>{const{ForwarderInputDropdown:h}=(0,M.A)();return r.createElement(r.Fragment,null,r.createElement(h,{onLoadMessage:f,label:"Forwarder Input selection (optional)",autoLoadMessage:!0}),r.createElement("p",{className:"description"},"Select an Input profile from the list below then select an then select an Input."))},G=({inputs:f,selectedInputId:h,onInputSelect:D,show:w})=>{const{ForwarderInputDropdown:S}=(0,M.A)(),[A,F]=(0,r.useState)();return w?B.A.isCloud()?r.createElement(j,{onInputSelect:D}):S?r.createElement("fieldset",null,r.createElement("legend",null,"Input selection (optional)"),r.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:A!=null?A:"placeholder",onChange:W=>F(W.target.value)},r.createElement("option",{value:"placeholder",disabled:!0},"Select an Input type"),r.createElement("option",{value:"server"},"Server Input"),r.createElement("option",{value:"forwarder"},"Forwarder Input")),A==="server"&&r.createElement(X,{inputs:f,selectedInputId:h,onInputSelect:D}),A==="forwarder"&&r.createElement(j,{onInputSelect:D})):r.createElement(X,{inputs:f,selectedInputId:h,onInputSelect:D}):null},H=({onMessageLoaded:f,inputIdSelector:h,codecTypes:D,inputs:w})=>{const[S,A]=(0,r.useState)(!1),[F,W]=(0,r.useState)(""),[Z,$]=(0,r.useState)(Q),[L,oe]=(0,r.useState)(""),[l,t]=(0,r.useState)({}),[o,n]=(0,r.useState)(),y=(0,ae.A)();(0,r.useEffect)(()=>{_.list()},[]),(0,r.useEffect)(()=>{h&&U.j.list()},[h]);const C=m=>{m.preventDefault(),A(!0);const u=te.o.loadRawMessage(F,Z,L,l);u.then(P=>{f(P,{message:F,remoteAddress:Z,codec:L,codecConfiguration:l,inputId:o})}),u.finally(()=>A(!1))},x=()=>{if(!D)return[{value:"none",label:"Loading codec types...",disabled:!0}];const m=Object.keys(D);return m.length===0?[{value:"none",label:"No codecs available"}]:m.filter(u=>u!=="random-http-msg").map(u=>{const{name:P}=D[u];return{value:u,label:P===""?u:P}}).sort((u,P)=>u.label.toLowerCase().localeCompare(P.label.toLowerCase()))},q=m=>{oe(m),t({})},Y=m=>{n(m)},re=m=>{W((0,p.yG)(m.target))},ne=m=>{$((0,p.yG)(m.target))},z=(m,u)=>{const P={...l,[m]:u};t(P)},ie=(m,u)=>{const P=l[m],V="RawMessageLoader",k=`${V}-${m}`;switch(u.type){case"text":return r.createElement(I.A_,{key:k,typeName:V,title:m,field:u,value:P,onChange:z});case"number":return r.createElement(I.oz,{key:k,typeName:V,title:m,field:u,value:P,onChange:z});case"boolean":return r.createElement(I.$f,{key:k,typeName:V,title:m,field:u,value:P,onChange:z});case"dropdown":return r.createElement(I.i2,{key:k,typeName:V,title:m,field:u,value:P,onChange:z});default:return null}},de=!F||!L||S;let le;if(D&&L){const m=D[L].requested_configuration;le=Object.keys(m).sort((u,P)=>m[u].is_optional-m[P].is_optional).map(u=>ie(u,m[u]))}return r.createElement(c.Row,null,r.createElement(c.Col,{md:7},r.createElement("form",{onSubmit:C},r.createElement("fieldset",null,r.createElement(c.Input,{id:"message",name:"message",type:"textarea",label:"Raw message",value:F,onChange:re,rows:3,required:!0}),r.createElement(c.Input,{id:"remoteAddress",name:"remoteAddress",type:"text",label:r.createElement("span",null,"Source IP address ",r.createElement("small",null,"(optional)")),help:`Remote IP address to use as message source. Graylog will use ${Q} by default.`,value:Z,onChange:ne})),r.createElement(G,{inputs:w,selectedInputId:o,onInputSelect:Y,show:h}),r.createElement("fieldset",null,r.createElement("legend",null,"Codec configuration"),r.createElement(c.Input,{id:"codec",name:"codec",label:"Message codec",help:"Select the codec that should be used to decode the message.",required:!0},r.createElement(a.l6,{id:"codec","aria-label":"Message codec",placeholder:"Select codec",options:x(),matchProp:"label",onChange:q,value:L})),le),r.createElement(a.hP,{submitButtonText:"Load message",submitLoadingText:"Loading message...",isSubmitting:S,isAsyncSubmit:!0,disabledSubmit:de,onCancel:()=>y.goBack()}))))};H.propTypes={onMessageLoaded:e().func.isRequired,inputIdSelector:e().bool,codecTypes:e().object,inputs:e().object},H.defaultProps={inputIdSelector:!1,codecTypes:void 0,inputs:void 0};const se=(0,E.A)(H,{inputs:U.C,codecTypes:ee},({inputs:{inputs:f},codecTypes:{codecTypes:h}})=>({inputs:f?b.Map(U.C.inputsAsMap(f)):void 0,codecTypes:h}))},"053yNwrM":(J,O,s)=>{s.d(O,{A:()=>e});var r=s("QL8i6bcz");const e=()=>{var b,p;return((p=(b=r.d.exports("forwarder"))==null?void 0:b[0])==null?void 0:p.messageLoaders)||{ForwarderInputDropdown:void 0}}},"8/L0uEJc":(J,O,s)=>{s.d(O,{A:()=>B});var r=s("ii0bleBb"),d=s.n(r),e=s("Z7aTuO5B"),b=s("ty2gyrHp"),p=s("rIl5IEuP"),a=s("xS8q27Jr"),c=Object.defineProperty,I=(g,i,v)=>i in g?c(g,i,{enumerable:!0,configurable:!0,writable:!0,value:v}):g[i]=v,E=(g,i,v)=>(I(g,typeof i!="symbol"?i+"":i,v),v);class M extends e.Component{constructor(){super(...arguments),E(this,"_refreshExtractorRoutes",i=>{this.newExtractorRoutes=a.A.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(b.m,{key:`menu-item-${i}`,to:this.newExtractorRoutes[i]},e.createElement(p.MenuItem,null,a.A.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.A.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 B=M},wzrLaWZc:(J,O,s)=>{s.d(O,{A:()=>oe});var r=s("ii0bleBb"),d=s.n(r),e=s("Z7aTuO5B"),b=s("VPaD/Np4"),p=s.n(b),a=s("rIl5IEuP"),c=s("TJOheZRu"),I=s("ty2gyrHp"),E=s("IOI9nV80"),M=s("Wh5iba66"),B=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,T=(l,t,o)=>(v(l,typeof t!="symbol"?t+"":t,o),o);const R=B.default.span(({theme:l})=>(0,B.css)`
margin-right: 8px;
font-family: ${l.fonts.family.monospace};
`);class N extends e.Component{constructor(t){super(t),T(this,"_shouldShowTerms",()=>{const{messageTerms:o}=this.state;return o.size!==0}),T(this,"_getFormattedTerms",()=>{const{messageTerms:o}=this.state;return o.map(n=>e.createElement(R,{key:n},n))}),T(this,"_getFormattedFieldActions",()=>{const{customFieldActions:o,fieldName:n,message:y}=this.props;return o?e.cloneElement(o,{fieldName:n,message:y}):null}),this.state={messageTerms:p().List()}}render(){const{fieldName:t,renderForDisplay:o}=this.props,n=t===g.Zv||t===g.TW?"message-field":"";return e.createElement("dd",{className:n,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()))}}T(N,"propTypes",{message:d().object.isRequired,fieldName:d().string.isRequired,renderForDisplay:d().func.isRequired,customFieldActions:d().node}),T(N,"defaultProps",{customFieldActions:void 0});const K=N;var _=s("8/L0uEJc");const ee=[g.TW,"level"],U=({message:l,value:t,fieldName:o,customFieldActions:n,renderForDisplay:y})=>{const C=ee.indexOf(o)!==-1?l.fields[o]:t;return e.createElement("span",null,e.createElement("dt",{key:`${o}Title`},o),e.createElement(K,{key:`${o}Description`,message:l,fieldName:o,fieldValue:C,renderForDisplay:y,customFieldActions:n}))};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"),Q=Object.defineProperty,X=(l,t,o)=>t in l?Q(l,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):l[t]=o,j=(l,t,o)=>(X(l,typeof t!="symbol"?t+"":t,o),o);class G extends e.Component{constructor(){super(...arguments),j(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,...n}=t.fields,y=t.formatted_fields||n,C=this._formatFields(y);return e.createElement(E.D2,{className:"message-details-fields"},C)}}j(G,"propTypes",{customFieldActions:d().node,message:d().object.isRequired,renderForDisplay:d().func.isRequired}),j(G,"defaultProps",{customFieldActions:void 0});const H=G;var se=s("Y2DdPzXi"),f=s("d4kzUuQm"),h=s("RCNj0OY4"),D=Object.defineProperty,w=(l,t,o)=>t in l?D(l,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):l[t]=o,S=(l,t,o)=>(w(l,typeof t!="symbol"?t+"":t,o),o);class A extends e.Component{constructor(){super(...arguments),S(this,"_inputName",t=>{const{inputs:o}=this.props,n=o.get(t);return n?e.createElement("span",{style:{wordBreak:"break-word"}},n.title):"deleted input"}),S(this,"_nodeName",t=>{const{nodes:o}=this.props,n=o.get(t);let y;if(n){const C=f.Ay.node(t),x=e.createElement(e.Fragment,null,e.createElement(E.In,{name:"fork_right"}),"\xA0",e.createElement("span",{style:{wordBreak:"break-word"}},n.short_node_id),"\xA0/\xA0",e.createElement("span",{style:{wordBreak:"break-word"}},n.hostname));y=h.A.isCloud()?x:e.createElement("a",{href:C},x)}else y=e.createElement("span",{style:{wordBreak:"break-word"}},"stopped node");return y}),S(this,"_formatMessageActions",()=>{const{message:t,customFieldActions:o}=this.props;if(!o)return e.createElement(a.ButtonGroup,{className:"pull-right",bsSize:"small"});const n=t.index?f.Ay.message_show(t.index,t.id):"#";return e.createElement(a.ButtonGroup,{className:"pull-right",bsSize:"small"},e.createElement(a.Button,{href:n},"Permalink"),e.createElement(E.bL,{title:"Copy ID",bsSize:"small",text:t.id}))}),S(this,"_getStreamLinks",t=>{const{streams:o,message:n}=this.props;return n.streams?n.streams.map(C=>e.createElement("li",{key:C.id},e.createElement(M.A,{stream:C}))):t.map(C=>{const x=o.get(C);return x!==void 0?e.createElement("li",{key:x.id},e.createElement(M.A,{stream:x})):null})})}render(){const{renderForDisplay:t,nodes:o,message:n,customFieldActions:y}=this.props,C=p().Set(n.stream_ids),x=this._getStreamLinks(C),q=n.source_radio_id?e.createElement("span",null,"via ",e.createElement("em",null,this._inputName(n.source_radio_input_id))," on radio ",this._nodeName(n.source_radio_id)):null,Y=n.fields.timestamp,re=[e.createElement("dt",{key:`dt-${Y}`},"Timestamp"),e.createElement("dd",{key:`dd-${Y}`},e.createElement(E.Dc,{dateTime:Y}))],ne=n.source_input_id&&n.source_node_id&&o?e.createElement("div",null,e.createElement("dt",null,"Received by"),e.createElement("dd",null,e.createElement("em",null,this._inputName(n.source_input_id))," ","on ",this._nodeName(n.source_node_id),q&&e.createElement("br",null),q)):null,z=n.index?e.createElement(I.N,{to:f.Ay.message_show(n.index,n.id)},n.id):e.createElement("span",null,n.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.A,null,e.createElement(E.In,{name:"mail"}),"\xA0",z))),e.createElement(a.Row,null,e.createElement(a.Col,{md:3},e.createElement(E.D2,null,re,ne,e.createElement("dt",null,"Stored in index"),e.createElement("dd",null,n.index?n.index:"Message is not stored"),C.size>0&&e.createElement("dt",null,"Routed into streams"),C.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(H,{message:n,renderForDisplay:t,customFieldActions:y})))))}}S(A,"propTypes",{renderForDisplay:d().func.isRequired,inputs:d().object,nodes:d().object,message:d().object.isRequired,streams:d().object,customFieldActions:d().node}),S(A,"defaultProps",{inputs:void 0,nodes:void 0,streams:void 0,customFieldActions:void 0});const F=A;var W=Object.defineProperty,Z=(l,t,o)=>t in l?W(l,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):l[t]=o,$=(l,t,o)=>(Z(l,typeof t!="symbol"?t+"":t,o),o);class L extends e.Component{constructor(t){super(t),$(this,"_getImmutableProps",o=>({streams:o.streams?p().Map(o.streams):o.streams,nodes:o.nodes?p().Map(o.nodes):o.nodes})),$(this,"renderForDisplay",o=>{const{message:n}=this.props;return c.A.stringify(n.fields[o])}),this.state=this._getImmutableProps(t)}UNSAFE_componentWillReceiveProps(t){this.setState(this._getImmutableProps(t))}render(){const{inputs:t,message:o}=this.props,{streams:n,nodes:y}=this.state;return e.createElement(a.Row,{className:"content"},e.createElement(a.Col,{md:12},e.createElement(F,{...this.props,message:o,inputs:t,streams:n,nodes:y,renderForDisplay:this.renderForDisplay,showTimestamp:!0})))}}$(L,"propTypes",{message:d().object.isRequired,inputs:d().object,streams:d().object,nodes:d().object}),$(L,"defaultProps",{inputs:void 0,nodes:void 0,streams:void 0});const oe=L},mr1MxJ4D:(J,O,s)=>{s.d(O,{A:()=>p});var r=s("9oVghaOd"),d=s.n(r),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,I,E,M,B){const g=e.A.filterFields(E);return{id:a,timestamp:d()(I.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:I.streams,highlight_ranges:M,decoration_stats:B}}}},eOHTbxJi:(J,O,s)=>{s.d(O,{o:()=>M});var r=s("JnTtTRmZ"),d=s.n(r),e=s("eFxcQyPT"),b=s("mr1MxJ4D"),p=s("U1Iufsob"),a=s("MdYBRjRJ"),c=s("jAGDuYSC"),I=s("TJOheZRu"),E=s("IA3Ku5lS");const M=(0,E.rN)("core.Messages",()=>d().createActions({loadMessage:{asyncResult:!0},fieldTerms:{asyncResult:!0},loadRawMessage:{asyncResult:!0}})),B=(0,E.Bv)("core.Messages",()=>d().createStore({listenables:[M],sourceUrl:"",getInitialState(){return{}},loadMessage(g,i){const{url:v}=p.A.MessagesController.single(g.trim(),i.trim()),T=(0,e.Ay)("GET",a.H3(v)).then(R=>b.A.formatResultMessage(R),R=>{c.A.error(`Loading message information failed with status: ${R}`,"Could not load message information")});M.loadMessage.promise(T)},fieldTerms(g,i){const{url:v}=p.A.MessagesController.analyze(g,encodeURIComponent(I.A.stringify(i))),T=(0,e.Ay)("GET",a.H3(v)).then(R=>R.tokens,R=>{c.A.error(`Loading field terms failed with status: ${R}`,"Could not load field terms.")});M.fieldTerms.promise(T)},loadRawMessage(g,i,v,T){const{url:R}=p.A.MessagesController.parse(),N={message:g,remote_address:i,codec:v,configuration:T},K=(0,e.Ay)("POST",a.H3(R),N).then(_=>b.A.formatResultMessage(_),_=>{if(_.additional&&_.additional.status===400){c.A.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.A.error(`Loading raw message failed with status: ${_}`,"Could not load raw message")});M.loadRawMessage.promise(K)}}))}}]);})();
//# sourceMappingURL=bb8c8232-4742.b7d2aac1c94609dffdc7.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy