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

web-interface.assets.1255d548-2065.e74b793f1df9b912dccc.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-2065"],{XsSj0a7j:(L,A,a)=>{a.d(A,{Z:()=>u});var x=a("pmX897Fv"),s=a.n(x),e=a("DjJvgDaP"),o=a.n(e),h=o()(s());h.push([L.id,`.VSICj_b2NVgn0qlbJSkn {
    margin-left: 1px;
}
`,"",{version:3,sources:["webpack://./src/components/extractors/extractors_configuration/GrokExtractorConfiguration.css"],names:[],mappings:"AAAA;IACI,gBAAgB;AACpB",sourcesContent:[`:local(.grokInput) {
    margin-left: 1px;
}
`],sourceRoot:""}]),h.locals={grokInput:"VSICj_b2NVgn0qlbJSkn"};const u=h},WXKdeTMX:(L,A,a)=>{a.d(A,{Z:()=>u});var x=a("pmX897Fv"),s=a.n(x),e=a("DjJvgDaP"),o=a.n(e),h=o()(s());h.push([L.id,`.YdarIKpxaNitFlWJ678S {
    height: 160px;
    max-height: 160px;
    overflow: hidden;
    overflow-y: scroll;
    padding-left: 0;
    border-bottom: 1px solid #ddd;
}

.kqwpZ3NGYl1tRenAeuma {
    margin-bottom: 0px;
}

.lmEVMuAgMnJwEQOO5HRZ {
    position: absolute;
    top: 7px;
    right: 7px;
}

.J36QQw1MHcjMFdoQeCi9 {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    display: block;
}
`,"",{version:3,sources:["webpack://./src/components/grok-patterns/GrokPatternFilter.css"],names:[],mappings:"AAAA;IACI,aAAa;IACb,iBAAiB;IACjB,gBAAgB;IAChB,kBAAkB;IAClB,eAAe;IACf,6BAA6B;AACjC;;AAEA;IACI,kBAAkB;AACtB;;AAEA;IACI,kBAAkB;IAClB,QAAQ;IACR,UAAU;AACd;;AAEA;IACI,uBAAuB;IACvB,mBAAmB;IACnB,gBAAgB;IAChB,cAAc;AAClB",sourcesContent:[`:local(.resultList) {
    height: 160px;
    max-height: 160px;
    overflow: hidden;
    overflow-y: scroll;
    padding-left: 0;
    border-bottom: 1px solid #ddd;
}

:local(.filterFormGroup) {
    margin-bottom: 0px;
}

:local(.addButton) {
    position: absolute;
    top: 7px;
    right: 7px;
}

:local(.patternDisplay) {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    display: block;
}
`],sourceRoot:""}]),h.locals={resultList:"YdarIKpxaNitFlWJ678S",filterFormGroup:"kqwpZ3NGYl1tRenAeuma",addButton:"lmEVMuAgMnJwEQOO5HRZ",patternDisplay:"J36QQw1MHcjMFdoQeCi9"};const u=h},HOQujLEr:(L,A,a)=>{a.d(A,{Z:()=>nr});var x=a("ii0bleBb"),s=a.n(x),e=a("Z7aTuO5B"),o=a("uZqmR+ju"),h=a("xS8q27Jr"),u=a("S6FuRS7B"),E=a("yTnlRDNA"),R=a("8UzJguce"),y=a("/GOzvPf6"),c=Object.defineProperty,_=(n,t,r)=>t in n?c(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,i=(n,t,r)=>(_(n,typeof t!="symbol"?t+"":t,r),r);class p extends e.Component{constructor(){super(...arguments),i(this,"_getConverterObject",t=>({type:this.props.type,config:t||this.props.configuration})),i(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)}),i(this,"_onChange",t=>r=>{const l=this.props.configuration;l[t]=u.ZP.getValueFromInput(r.target),this.props.onChange(this.props.type,this._getConverterObject(l))})}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject())}render(){const t=e.createElement("span",null,"For example ",e.createElement("code",null,","),", ",e.createElement("code",null,"\\n"),", and ",e.createElement("code",null,"\\t")," will be translated to a single character.");return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",ref:r=>{this.converterEnabled=r},id:`enable-${this.props.type}-converter`,label:"Add CSV columns as fields",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}),e.createElement(o.Row,{className:"row-sm"},e.createElement(o.Col,{md:9,mdOffset:2},e.createElement("div",{className:"xtrc-converter-subfields"},e.createElement(o.Input,{type:"text",id:`${this.props.type}_converter_column_header`,label:"Field names",defaultValue:this.props.configuration.column_header,labelClassName:"col-md-3",wrapperClassName:"col-md-9",placeholder:"field1,field2,field3",onChange:this._onChange("column_header"),required:this.converterEnabled&&this.converterEnabled.getChecked()}),e.createElement(o.Input,{type:"text",id:`${this.props.type}_converter_separator`,label:"Separator character",defaultValue:this.props.configuration.separator||",",labelClassName:"col-md-3",wrapperClassName:"col-md-9",maxLength:"2",onChange:this._onChange("separator"),help:t}),e.createElement(o.Input,{type:"text",id:`${this.props.type}_converter_quote_char`,label:"Quote character",defaultValue:this.props.configuration.quote_char||'"',labelClassName:"col-md-3",wrapperClassName:"col-md-9",maxLength:"1",onChange:this._onChange("quote_char")}),e.createElement(o.Input,{type:"text",id:`${this.props.type}_converter_escape_char`,label:"Escape character",defaultValue:this.props.configuration.escape_char||"\\",labelClassName:"col-md-3",wrapperClassName:"col-md-9",maxLength:"1",onChange:this._onChange("escape_char"),help:"Character used to escape the separator and quote characters."}),e.createElement(o.Input,{type:"checkbox",id:`${this.props.type}_converter_strict_quotes`,label:"Use strict quotes",wrapperClassName:"col-md-offset-3 col-md-9",defaultChecked:this.props.configuration.strict_quotes,onChange:this._onChange("strict_quotes"),help:"Ignore content outside of quotes."}),e.createElement(o.Input,{type:"checkbox",id:`${this.props.type}_converter_trim_leading_whitespace`,label:"Trim leading whitespace",wrapperClassName:"col-md-offset-3 col-md-9",defaultChecked:this.props.configuration.trim_leading_whitespace,onChange:this._onChange("trim_leading_whitespace")})))))}}i(p,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const g=p;var m=a("7dh0vSOR"),f=a("E+CaPsQD"),P=Object.defineProperty,I=(n,t,r)=>t in n?P(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,O=(n,t,r)=>(I(n,typeof t!="symbol"?t+"":t,r),r);class N extends e.Component{constructor(){super(...arguments),O(this,"_getConverterObject",t=>({type:this.props.type,config:t||this.props.configuration})),O(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)}),O(this,"_onChange",t=>r=>{const l=this.props.configuration;l[t]=typeof r=="object"?u.ZP.getValueFromInput(r.target):r,this.props.onChange(this.props.type,this._getConverterObject(l))})}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject())}render(){const t=e.createElement("span",null,"String format the date uses. Read more in the ",e.createElement(m.Z,{page:f.Z.PAGES.PAGE_STANDARD_DATE_CONVERTER,text:"documentation"}),"."),r=e.createElement("span",null,"Time zone to apply to date. Read more in the ",e.createElement(m.Z,{page:f.Z.PAGES.PAGE_STANDARD_DATE_CONVERTER,text:"documentation"}),"."),l=e.createElement("span",null,"Locale to use when parsing the date. Read more in the ",e.createElement(m.Z,{page:f.Z.PAGES.PAGE_STANDARD_DATE_CONVERTER,text:"documentation"}),".");return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",ref:C=>{this.converterEnabled=C},id:`enable-${this.props.type}-converter`,label:"Convert to date type",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}),e.createElement(o.Row,{className:"row-sm"},e.createElement(o.Col,{md:9,mdOffset:2},e.createElement("div",{className:"xtrc-converter-subfields"},e.createElement(o.Input,{type:"text",id:`${this.props.type}_converter_date_format`,label:"Format string",defaultValue:this.props.configuration.date_format,labelClassName:"col-md-3",wrapperClassName:"col-md-9",placeholder:"yyyy-MM-dd HH:mm:ss.SSS",onChange:this._onChange("date_format"),required:this.converterEnabled&&this.converterEnabled.getChecked(),help:t}),e.createElement(o.Input,{label:"Time Zone",id:`${this.props.type}_converter_timezone`,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",help:r},e.createElement(y.Cc,{id:`${this.props.type}_converter_timezone`,className:"timezone-select",value:this.props.configuration.time_zone,onChange:this._onChange("time_zone")})),e.createElement(o.Input,{label:"Locale",id:`${this.props.type}_converter_locale`,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",help:l},e.createElement(y.Vf,{id:`${this.props.type}_converter_locale`,className:"locale-select",value:this.props.configuration.locale,onChange:this._onChange("locale")}))))))}}O(N,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const V=N;var F=Object.defineProperty,q=(n,t,r)=>t in n?F(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,W=(n,t,r)=>(q(n,typeof t!="symbol"?t+"":t,r),r);class B extends e.Component{constructor(){super(...arguments),W(this,"_getConverterObject",t=>({type:this.props.type,config:t||this.props.configuration})),W(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)}),W(this,"_onChange",t=>r=>{const l=this.props.configuration;l[t]=typeof r=="object"?u.ZP.getValueFromInput(r.target):r,this.props.onChange(this.props.type,this._getConverterObject(l))})}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject())}render(){const t=e.createElement("span",null,"Time zone to apply to date. Read more in the ",e.createElement(m.Z,{page:f.Z.PAGES.PAGE_FLEXIBLE_DATE_CONVERTER,text:"documentation"}),".");return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",id:`enable-${this.props.type}-converter`,label:"Flexibly parse date",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}),e.createElement(o.Row,{className:"row-sm"},e.createElement(o.Col,{md:9,mdOffset:2},e.createElement("div",{className:"xtrc-converter-subfields"},e.createElement(o.Input,{label:"Time Zone",id:`${this.props.type}_converter_timezone`,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",help:t},e.createElement(y.Cc,{id:`${this.props.type}_converter_timezone`,className:"timezone-select",value:this.props.configuration.time_zone,onChange:this._onChange("time_zone")}))))))}}W(B,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const ae=B;var le=Object.defineProperty,ce=(n,t,r)=>t in n?le(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,z=(n,t,r)=>(ce(n,typeof t!="symbol"?t+"":t,r),r);class $ extends e.Component{constructor(){super(...arguments),z(this,"_getConverterObject",()=>({type:this.props.type,config:this.props.configuration})),z(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)})}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject())}render(){return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",id:`enable-${this.props.type}-converter`,label:"Build MD5 hash from value",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}))}}z($,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const Q=$;var U=Object.defineProperty,M=(n,t,r)=>t in n?U(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,T=(n,t,r)=>(M(n,typeof t!="symbol"?t+"":t,r),r);class b extends e.Component{constructor(){super(...arguments),T(this,"_getConverterObject",()=>({type:this.props.type,config:this.props.configuration})),T(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)})}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject())}render(){return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",id:`enable-${this.props.type}-converter`,label:"Anonymize IPv4 addresses by replacing last octet",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}))}}T(b,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const k=b;var S=Object.defineProperty,j=(n,t,r)=>t in n?S(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,K=(n,t,r)=>(j(n,typeof t!="symbol"?t+"":t,r),r);class ee extends e.Component{constructor(){super(...arguments),K(this,"_getConverterObject",()=>({type:this.props.type,config:this.props.configuration})),K(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)})}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject())}render(){return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",id:`enable-${this.props.type}-converter`,label:"Transform value to lowercase",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}))}}K(ee,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const D=ee;var w=Object.defineProperty,se=(n,t,r)=>t in n?w(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,G=(n,t,r)=>(se(n,typeof t!="symbol"?t+"":t,r),r);class te extends e.Component{constructor(){super(...arguments),G(this,"_getConverterObject",()=>({type:this.props.type,config:this.props.configuration})),G(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)})}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject())}render(){return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",id:`enable-${this.props.type}-converter`,label:"Convert to numeric value",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}))}}G(te,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const Ke=te;var Ge=Object.defineProperty,Ve=(n,t,r)=>t in n?Ge(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,ge=(n,t,r)=>(Ve(n,typeof t!="symbol"?t+"":t,r),r);class Ae extends e.Component{constructor(){super(...arguments),ge(this,"_getConverterObject",t=>({type:this.props.type,config:t||this.props.configuration})),ge(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)}),ge(this,"_onChange",t=>r=>{const l=this.props.configuration;l[t]=u.ZP.getValueFromInput(r.target),this.props.onChange(this.props.type,this._getConverterObject(l))})}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject())}render(){const t=e.createElement("span",null,"The Split & Count converter is splitting the extracted part by the defined character and stores the token"," ","count as field. ",e.createElement("strong",null,"Example:")," ",e.createElement("em",null,"?fields=first_name,last_name,zip")," split by ",e.createElement("em",null,",")," ","results in ",e.createElement("em",null,"3"),". You just counted the requested fields of a GET user REST request.");return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",ref:r=>{this.converterEnabled=r},id:`enable-${this.props.type}-converter`,label:"Split & Count",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}),e.createElement(o.Row,{className:"row-sm"},e.createElement(o.Col,{md:9,mdOffset:2},e.createElement("div",{className:"xtrc-converter-subfields"},e.createElement(o.Input,{type:"text",id:`${this.props.type}_converter_split_by`,label:"Split by",defaultValue:this.props.configuration.split_by,labelClassName:"col-md-3",wrapperClassName:"col-md-9",onChange:this._onChange("split_by"),required:this.converterEnabled&&this.converterEnabled.getChecked(),help:t})))))}}ge(Ae,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const He=Ae;var Je=Object.defineProperty,ze=(n,t,r)=>t in n?Je(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,Ce=(n,t,r)=>(ze(n,typeof t!="symbol"?t+"":t,r),r);class Me extends e.Component{constructor(){super(...arguments),Ce(this,"_getConverterObject",()=>({type:this.props.type,config:this.props.configuration})),Ce(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)})}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject())}render(){return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",id:`enable-${this.props.type}-converter`,label:"Convert from PRI to syslog facility",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}))}}Ce(Me,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const Xe=Me;var Ye=Object.defineProperty,qe=(n,t,r)=>t in n?Ye(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,Ee=(n,t,r)=>(qe(n,typeof t!="symbol"?t+"":t,r),r);class Se extends e.Component{constructor(){super(...arguments),Ee(this,"_getConverterObject",()=>({type:this.props.type,config:this.props.configuration})),Ee(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)})}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject())}render(){return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",id:`enable-${this.props.type}-converter`,label:"Convert from PRI to syslog level",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}))}}Ee(Se,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const Qe=Se;var et=Object.defineProperty,tt=(n,t,r)=>t in n?et(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,_e=(n,t,r)=>(tt(n,typeof t!="symbol"?t+"":t,r),r);class De extends e.Component{constructor(){super(...arguments),_e(this,"_getConverterObject",()=>({type:this.props.type,config:this.props.configuration})),_e(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)})}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject())}render(){return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",id:`enable-${this.props.type}-converter`,label:"Add Key=Value pairs as fields",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}))}}_e(De,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const rt=De;var nt=Object.defineProperty,ot=(n,t,r)=>t in n?nt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,ve=(n,t,r)=>(ot(n,typeof t!="symbol"?t+"":t,r),r);class Ne extends e.Component{constructor(){super(...arguments),ve(this,"_getConverterObject",()=>({type:this.props.type,config:this.props.configuration})),ve(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)})}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject())}render(){return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",id:`enable-${this.props.type}-converter`,label:"Transform value to uppercase",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}))}}ve(Ne,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const at=Ne;var Le=a("ty2gyrHp"),we=a("d4kzUuQm"),Ze=a("xPjmrmtt"),st=Object.defineProperty,it=(n,t,r)=>t in n?st(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,re=(n,t,r)=>(it(n,typeof t!="symbol"?t+"":t,r),r);class Fe extends e.Component{constructor(){super(...arguments),re(this,"state",{lookupTables:void 0}),re(this,"_getConverterObject",t=>({type:this.props.type,config:t||this.props.configuration})),re(this,"_toggleConverter",t=>{let r;u.ZP.getValueFromInput(t.target)===!0&&(r=this._getConverterObject()),this.props.onChange(this.props.type,r)}),re(this,"_updateConfigValue",(t,r)=>{const l=this.props.configuration;l[t]=r,this.props.onChange(this.props.type,this._getConverterObject(l))}),re(this,"_onChange",t=>r=>this._updateConfigValue(t,u.ZP.getValueFromInput(r.target))),re(this,"_onSelect",t=>r=>this._updateConfigValue(t,r))}componentDidMount(){this.props.onChange(this.props.type,this._getConverterObject()),Ze.H.searchPaginated(1,1e4,null).then(t=>{this.setState({lookupTables:t.lookup_tables})})}render(){if(!this.state.lookupTables)return e.createElement(y.$j,null);const t=this.state.lookupTables.map(l=>({label:l.title,value:l.name})),r=e.createElement("span",null,"Lookup tables can be created ",e.createElement(Le.r,{to:we.ZP.SYSTEM.LOOKUPTABLES.OVERVIEW},"here"),".");return e.createElement("div",{className:"xtrc-converter"},e.createElement(o.Input,{type:"checkbox",ref:l=>{this.converterEnabled=l},id:`enable-${this.props.type}-converter`,label:"Convert value by using lookup table",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:!0,onChange:this._toggleConverter}),e.createElement(o.Row,{className:"row-sm"},e.createElement(o.Col,{md:9,mdOffset:2},e.createElement("div",{className:"xtrc-converter-subfields"},e.createElement(o.Input,{id:"lookup_table_name",label:"Lookup Table",labelClassName:"col-md-3",wrapperClassName:"col-md-9",required:this.converterEnabled&&this.converterEnabled.getChecked(),help:r},e.createElement(y.Ph,{placeholder:"Select a lookup table",clearable:!1,options:t,matchProp:"label",onChange:this._onSelect("lookup_table_name"),value:this.props.configuration.lookup_table_name}))))))}}re(Fe,"propTypes",{type:s().string.isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired});const lt=Fe;var ct=Object.defineProperty,pt=(n,t,r)=>t in n?ct(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,ne=(n,t,r)=>(pt(n,typeof t!="symbol"?t+"":t,r),r);class Be extends e.Component{constructor(t){super(t),ne(this,"_onConverterSelect",r=>{this.setState({selectedConverter:r})}),ne(this,"_onConverterAdd",()=>{const{displayedConverters:r,selectedConverter:l}=this.state,C=r.concat(l);this.setState({selectedConverter:void 0,displayedConverters:C})}),ne(this,"_onConverterChange",(r,l)=>{const{disabledConverters:C}=this.state,{onChange:d}=this.props;if(l){const v=C;"converterType"in v&&(delete v[r],this.setState({disabledConverters:v}))}else{const v=C;v[r]=this._getConverterByType(r),this.setState({disabledConverters:v})}d(r,l)}),ne(this,"_getConverterOptions",()=>{const{displayedConverters:r}=this.state,l=[];return Object.keys(h.Z.ConverterTypes).forEach(C=>{const d=h.Z.ConverterTypes[C],v=r.indexOf(d)!==-1;l.push({value:d,label:h.Z.getReadableConverterTypeName(d),disabled:v})}),l}),ne(this,"_getConverterByType",r=>{const{converters:l}=this.props,C=l.filter(d=>d.type===r)[0];return C?C.config:{}}),ne(this,"_getConvertersConfiguration",()=>{const{displayedConverters:r,disabledConverters:l}=this.state;return r.map(d=>{let v=this._getConverterByType(d);switch(Object.keys(v).length===0&&"converterType"in l&&(v=l[d]),d){case h.Z.ConverterTypes.NUMERIC:return e.createElement(Ke,{key:d,type:d,configuration:v,onChange:this._onConverterChange});case h.Z.ConverterTypes.DATE:return e.createElement(V,{key:d,type:d,configuration:v,onChange:this._onConverterChange});case h.Z.ConverterTypes.HASH:return e.createElement(Q,{key:d,type:d,configuration:v,onChange:this._onConverterChange});case h.Z.ConverterTypes.SPLIT_AND_COUNT:return e.createElement(He,{key:d,type:d,configuration:v,onChange:this._onConverterChange});case h.Z.ConverterTypes.IP_ANONYMIZER:return e.createElement(k,{key:d,type:d,configuration:v,onChange:this._onConverterChange});case h.Z.ConverterTypes.SYSLOG_PRI_LEVEL:return e.createElement(Qe,{key:d,type:d,configuration:v,onChange:this._onConverterChange});case h.Z.ConverterTypes.SYSLOG_PRI_FACILITY:return e.createElement(Xe,{key:d,type:d,configuration:v,onChange:this._onConverterChange});case h.Z.ConverterTypes.TOKENIZER:return e.createElement(rt,{key:d,type:d,configuration:v,onChange:this._onConverterChange});case h.Z.ConverterTypes.CSV:return e.createElement(g,{key:d,type:d,configuration:v,onChange:this._onConverterChange});case h.Z.ConverterTypes.LOWERCASE:return e.createElement(D,{key:d,type:d,configuration:v,onChange:this._onConverterChange});case h.Z.ConverterTypes.UPPERCASE:return e.createElement(at,{key:d,type:d,configuration:v,onChange:this._onConverterChange});case h.Z.ConverterTypes.FLEXDATE:return e.createElement(ae,{key:d,type:d,configuration:v,onChange:this._onConverterChange});case h.Z.ConverterTypes.LOOKUP_TABLE:return e.createElement(lt,{key:d,type:d,configuration:v,onChange:this._onConverterChange});default:return console.warn(`Converter type ${d} is not supported.`),e.createElement(e.Fragment,null)}})}),this.state={displayedConverters:t.converters.map(r=>r.type),disabledConverters:{},selectedConverter:void 0}}render(){const{extractorType:t}=this.props,{selectedConverter:r}=this.state;return t===h.Z.ExtractorTypes.GROK||t===h.Z.ExtractorTypes.JSON?e.createElement("div",{className:"form-group"},e.createElement("div",{className:"col-md-offset-2 col-md-10"},e.createElement(o.Panel,{bsStyle:"info",style:{marginBottom:0}},"Cannot add converters to"," ",e.createElement("em",null,h.Z.getReadableExtractorTypeName(t))," extractors."))):e.createElement("div",null,e.createElement(o.Input,{id:"add-converter",label:"Add converter",labelClassName:"col-md-2",wrapperClassName:"col-md-10",help:"Add converters to transform the extracted value."},e.createElement(o.Row,{className:"row-sm"},e.createElement(o.Col,{md:11},e.createElement(y.Ph,{id:"add-converter",placeholder:"Select a converter",options:this._getConverterOptions(),value:r,onChange:this._onConverterSelect})),e.createElement(o.Col,{md:1,className:"text-right"},e.createElement(o.Button,{bsStyle:"info",onClick:this._onConverterAdd,disabled:!r},"Add")))),this._getConvertersConfiguration())}}ne(Be,"propTypes",{extractorType:s().string.isRequired,converters:s().array.isRequired,onChange:s().func.isRequired});const ut=Be;class dt extends e.Component{render(){return e.createElement("div",{className:"form-group"},e.createElement("div",{className:"col-md-offset-2 col-md-10"},e.createElement(o.Panel,{bsStyle:"info",style:{marginBottom:0}},"The entire input will be copied verbatim.")))}}const gt=dt;var mt=a("5chL1ePP"),H=a("jAGDuYSC"),ht=a("ZYJ7aiK3"),ft=a("dFpwyWHg"),Ct=a.n(ft),Et=a("C2ikvoS0"),_t=a.n(Et),vt=a("1IntWRSu"),yt=a.n(vt),xt=a("8nGWeFnd"),bt=a.n(xt),Pt=a("TeAcaicX"),Tt=a.n(Pt),Rt=a("eE3+5goe"),Ot=a.n(Rt),me=a("XsSj0a7j"),ie={};ie.styleTagTransform=Ot(),ie.setAttributes=bt(),ie.insert=yt().bind(null,"head"),ie.domAPI=_t(),ie.insertStyleElement=Tt();var lr=Ct()(me.Z,ie);const It=me.Z&&me.Z.locals?me.Z.locals:void 0;var At=Object.defineProperty,Mt=(n,t,r)=>t in n?At(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,X=(n,t,r)=>(Mt(n,typeof t!="symbol"?t+"":t,r),r);class ye extends e.Component{constructor(){super(...arguments),X(this,"state",{trying:!1,patterns:[]}),X(this,"loadData",()=>{this.loadPromise=ht.o.loadPatterns(t=>{this.loadPromise.isCancelled()||(this.loadPromise=void 0,this.setState({patterns:t}))})}),X(this,"_onChange",t=>{const{onChange:r,onExtractorPreviewLoad:l,configuration:C}=this.props;return d=>{l(void 0);const v=C;v[t]=u.ZP.getValueFromInput(d.target),r(v)}}),X(this,"_onPatternChange",t=>{const{onChange:r,onExtractorPreviewLoad:l,configuration:C}=this.props;l(void 0);const d=C;d.grok_pattern=t,r(d)}),X(this,"_onTryClick",()=>{const{exampleMessage:t,configuration:r,onExtractorPreviewLoad:l}=this.props;this.setState({trying:!0});const C=E.Z.testGrok(r.grok_pattern,r.named_captures_only,t);C.then(d=>{if(d.error_message!=null){H.Z.error(`We were not able to run the grok extraction because of the following error: ${d.error_message}`);return}if(!d.matched){H.Z.warning("We were not able to run the grok extraction. Please check your parameters.");return}const v=[];d.matches.forEach(J=>{v.push(e.createElement("dt",{key:`${J.name}-name`},J.name)),v.push(e.createElement("dd",{key:`${J.name}-value`},e.createElement("samp",null,J.match)))});const oe=v.length===0?"":e.createElement("dl",null,v);l(oe)}),C.finally(()=>this.setState({trying:!1}))}),X(this,"_isTryButtonDisabled",()=>{const{trying:t}=this.state,{configuration:r,exampleMessage:l}=this.props;return t||!r.grok_pattern||!l})}componentDidMount(){this.loadData()}componentWillUnmount(){this.loadPromise&&this.loadPromise.cancel()}render(){const{patterns:t,trying:r}=this.state,{configuration:l}=this.props;return e.createElement("div",null,e.createElement(o.Input,{type:"checkbox",id:"named_captures_only",label:"Named captures only",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:l.named_captures_only,onChange:this._onChange("named_captures_only"),help:"Only put the explicitly named captures into the message."}),e.createElement(o.Row,null,e.createElement(o.Col,{mdOffset:1,md:1},e.createElement(o.ControlLabel,{className:"col-md-offset-2"},"Grok pattern")),e.createElement(o.Col,{md:10},e.createElement(mt.Z,{onPatternChange:this._onPatternChange,pattern:l.grok_pattern||"",patterns:t,className:It.grokInput}))),e.createElement(o.Row,null,e.createElement(o.Col,{mdOffset:2,md:1},e.createElement(o.Button,{bsStyle:"info",onClick:this._onTryClick,disabled:this._isTryButtonDisabled()},r?e.createElement(y.JO,{name:"spinner",spin:!0}):"Try against example"))))}}X(ye,"propTypes",{configuration:s().object.isRequired,exampleMessage:s().string,onChange:s().func.isRequired,onExtractorPreviewLoad:s().func.isRequired}),X(ye,"defaultProps",{exampleMessage:void 0});const St=ye;var Dt=a("D4SbLiE/"),Ue=a.n(Dt);const Nt=Ue()({displayName:"JSONExtractorConfiguration",propTypes:{configuration:s().object.isRequired,exampleMessage:s().string,onChange:s().func.isRequired,onExtractorPreviewLoad:s().func.isRequired},getInitialState(){return{trying:!1,configuration:this._getEffectiveConfiguration(this.props.configuration)}},componentDidMount(){this.props.onChange(this.state.configuration)},UNSAFE_componentWillReceiveProps(n){this.setState({configuration:this._getEffectiveConfiguration(n.configuration)})},DEFAULT_CONFIGURATION:{list_separator:", ",key_separator:"_",kv_separator:"=",key_prefix:"",replace_key_whitespace:!1,key_whitespace_replacement:"_"},_getEffectiveConfiguration(n){return h.Z.getEffectiveConfiguration(this.DEFAULT_CONFIGURATION,n)},_onChange(n){return t=>{this.props.onExtractorPreviewLoad(void 0);const r=this.state.configuration;r[n]=u.ZP.getValueFromInput(t.target),this.props.onChange(r)}},_onTryClick(){this.setState({trying:!0});const{configuration:n}=this.state,t=E.Z.testJSON(n.flatten,n.list_separator,n.key_separator,n.kv_separator,n.replace_key_whitespace,n.key_whitespace_replacement,n.key_prefix,this.props.exampleMessage);t.then(r=>{const l=[];for(const d in r.matches)r.matches.hasOwnProperty(d)&&(l.push(e.createElement("dt",{key:`${d}-name`},d)),l.push(e.createElement("dd",{key:`${d}-value`},e.createElement("samp",null,r.matches[d]))));const C=l.length===0?"":e.createElement("dl",null,l);this.props.onExtractorPreviewLoad(C)}),t.finally(()=>this.setState({trying:!1}))},_isTryButtonDisabled(){return this.state.trying||!this.props.exampleMessage},render(){return e.createElement("div",null,e.createElement(o.Input,{type:"checkbox",id:"flatten",label:"Flatten structures",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:this.state.configuration.flatten,onChange:this._onChange("flatten"),help:"Whether to flatten JSON objects into a single message field or to expand into multiple fields."}),e.createElement(o.Input,{type:"text",id:"list_separator",label:"List item separator",labelClassName:"col-md-2",wrapperClassName:"col-md-10",defaultValue:this.state.configuration.list_separator,required:!0,onChange:this._onChange("list_separator"),help:"What string to use to concatenate items of a JSON list."}),e.createElement(o.Input,{type:"text",id:"key_separator",label:"Key separator",labelClassName:"col-md-2",wrapperClassName:"col-md-10",defaultValue:this.state.configuration.key_separator,required:!0,onChange:this._onChange("key_separator"),help:e.createElement("span",null,"What string to use to concatenate different keys of a nested JSON object (only used if ",e.createElement("em",null,"not")," flattened).")}),e.createElement(o.Input,{type:"text",id:"kv_separator",label:"Key/value separator",labelClassName:"col-md-2",wrapperClassName:"col-md-10",defaultValue:this.state.configuration.kv_separator,required:!0,onChange:this._onChange("kv_separator"),help:"What string to use when concatenating key/value pairs of a JSON object (only used if flattened)."}),e.createElement(o.Input,{type:"text",id:"key_prefix",label:"Key prefix",labelClassName:"col-md-2",wrapperClassName:"col-md-10",defaultValue:this.state.configuration.key_prefix,onChange:this._onChange("key_prefix"),help:"Text to prepend to each key extracted from the JSON object."}),e.createElement(o.Input,{type:"checkbox",id:"replace_key_whitespace",label:"Replace whitespaces in keys",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:this.state.configuration.replace_key_whitespace,onChange:this._onChange("replace_key_whitespace"),help:"Field keys containing whitespaces will be discarded when storing the extracted message. Check this box to replace whitespaces in JSON keys with another character."}),e.createElement(o.Input,{type:"text",id:"key_whitespace_replacement",label:"Key whitespace replacement",labelClassName:"col-md-2",wrapperClassName:"col-md-10",defaultValue:this.state.configuration.key_whitespace_replacement,disabled:!this.state.configuration.replace_key_whitespace,required:!0,onChange:this._onChange("key_whitespace_replacement"),help:"What character to use when replacing whitespaces in message keys. Please ensure the replacement character is valid in Lucene, e.g. '-' or '_'."}),e.createElement(o.Row,null,e.createElement(o.Col,{mdOffset:2,md:10},e.createElement(o.Button,{bsStyle:"info",onClick:this._onTryClick,disabled:this._isTryButtonDisabled()},this.state.trying?e.createElement(y.JO,{name:"spinner",spin:!0}):"Try"))))}});var Lt=Object.defineProperty,wt=(n,t,r)=>t in n?Lt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,pe=(n,t,r)=>(wt(n,typeof t!="symbol"?t+"":t,r),r);class ke extends e.Component{constructor(){super(...arguments),pe(this,"state",{trying:!1}),pe(this,"_onChange",t=>r=>{this.props.onExtractorPreviewLoad(void 0);const l=this.props.configuration;l[t]=u.ZP.getValueFromInput(r.target),this.props.onChange(l)}),pe(this,"_onTryClick",()=>{this.setState({trying:!0});const t=E.Z.testRegex(this.props.configuration.regex_value,this.props.exampleMessage);t.then(r=>{if(!r.matched){H.Z.warning("Regular expression did not match.");return}if(!r.match){H.Z.warning("Regular expression does not contain any matcher group to extract.");return}const l=r.match.match?e.createElement("samp",null,r.match.match):"";this.props.onExtractorPreviewLoad(l)}),t.finally(()=>this.setState({trying:!1}))}),pe(this,"_isTryButtonDisabled",()=>this.state.trying||!this.props.configuration.regex_value||!this.props.exampleMessage)}render(){const t=e.createElement("span",null,"The regular expression used for extraction. First matcher group is used."," ","Learn more in the ",e.createElement(m.Z,{page:f.Z.PAGES.EXTRACTORS,text:"documentation"}),".");return e.createElement("div",null,e.createElement(o.Input,{id:"regex-value-input",label:"Regular expression",labelClassName:"col-md-2",wrapperClassName:"col-md-10",help:t},e.createElement(o.Row,{className:"row-sm"},e.createElement(o.Col,{md:11},e.createElement("input",{type:"text",id:"regex_value",className:"form-control",defaultValue:this.props.configuration.regex_value,placeholder:"^.*string(.+)$",onChange:this._onChange("regex_value"),required:!0})),e.createElement(o.Col,{md:1,className:"text-right"},e.createElement(o.Button,{bsStyle:"info",onClick:this._onTryClick,disabled:this._isTryButtonDisabled()},this.state.trying?e.createElement(y.JO,{name:"spinner",spin:!0}):"Try")))))}}pe(ke,"propTypes",{configuration:s().object.isRequired,exampleMessage:s().string,onChange:s().func.isRequired,onExtractorPreviewLoad:s().func.isRequired});const Zt=ke;var Ft=Object.defineProperty,Bt=(n,t,r)=>t in n?Ft(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,ue=(n,t,r)=>(Bt(n,typeof t!="symbol"?t+"":t,r),r);class We extends e.Component{constructor(){super(...arguments),ue(this,"state",{trying:!1}),ue(this,"_onChange",t=>r=>{this.props.onExtractorPreviewLoad(void 0);const l=this.props.configuration;l[t]=u.ZP.getValueFromInput(r.target),this.props.onChange(l)}),ue(this,"_onTryClick",()=>{this.setState({trying:!0});const{configuration:t}=this.props,r=E.Z.testRegexReplace(t.regex,t.replacement,t.replace_all,this.props.exampleMessage);r.then(l=>{if(!l.matched){H.Z.warning("Regular expression did not match.");return}if(!l.match){H.Z.warning("Regular expression does not contain any matcher group to extract.");return}const C=l.match.match?e.createElement("samp",null,l.match.match):"";this.props.onExtractorPreviewLoad(C)}),r.finally(()=>this.setState({trying:!1}))}),ue(this,"_isTryButtonDisabled",()=>this.state.trying||!this.props.configuration.regex||!this.props.configuration.replacement||!this.props.exampleMessage)}render(){const t=e.createElement("span",null,"The regular expression used for extraction."," ","Learn more in the ",e.createElement(m.Z,{page:f.Z.PAGES.EXTRACTORS,text:"documentation"}),"."),r=e.createElement("span",null,"The replacement used for the matching text. Please refer to the"," ",e.createElement("a",{target:"_blank",href:"https://docs.oracle.com/javase/7/docs/api/java/util/regex/Matcher.html#replaceAll(java.lang.String)",rel:"noreferrer"},"Matcher")," ","API documentation for the possible options.");return e.createElement("div",null,e.createElement(o.Input,{type:"text",id:"regex",label:"Regular expression",labelClassName:"col-md-2",placeholder:"^.*string(.+)$",onChange:this._onChange("regex"),wrapperClassName:"col-md-10",defaultValue:this.props.configuration.regex,required:!0,help:t}),e.createElement(o.Input,{type:"text",id:"replacement",label:"Replacement",labelClassName:"col-md-2",placeholder:"$1",onChange:this._onChange("replacement"),wrapperClassName:"col-md-10",defaultValue:this.props.configuration.replacement,required:!0,help:r}),e.createElement(o.Input,{type:"checkbox",id:"replace_all",label:"Replace all occurrences of the pattern",wrapperClassName:"col-md-offset-2 col-md-10",defaultChecked:this.props.configuration.replace_all,onChange:this._onChange("replace_all"),help:"Whether to replace all occurrences of the given pattern or only the first occurrence."}),e.createElement(o.Row,null,e.createElement(o.Col,{mdOffset:2,md:10},e.createElement(o.Button,{bsStyle:"info",onClick:this._onTryClick,disabled:this._isTryButtonDisabled()},this.state.trying?e.createElement(y.JO,{name:"spinner",spin:!0}):"Try"))))}}ue(We,"propTypes",{configuration:s().object.isRequired,exampleMessage:s().string,onChange:s().func.isRequired,onExtractorPreviewLoad:s().func.isRequired});const Ut=We,kt={index:1},$e=n=>h.Z.getEffectiveConfiguration(kt,n),xe=({configuration:n,exampleMessage:t,onChange:r,onExtractorPreviewLoad:l})=>{const[C,d]=(0,e.useState)($e(n));(0,e.useEffect)(()=>{d($e(n))},[n]);const[v,oe]=(0,e.useState)(!1),J=he=>de=>{l(void 0);const fe=C;fe[he]=u.ZP.getValueFromInput(de.target),r(fe)},or=(0,e.useCallback)(()=>{oe(!0);const he=E.Z.testSplitAndIndex(C.split_by,C.index,t);he.then(de=>{if(!de.successful){H.Z.warning("We were not able to run the split and index extraction. Please check your parameters.");return}const fe=de.cut?e.createElement("samp",null,de.cut):"";l(fe)}),he.finally(()=>oe(!1))},[C.index,C.split_by,t,l]),ar=e.createElement("span",null,"What character to split on. ",e.createElement("strong",null,"Example:")," A whitespace character will split"," ",e.createElement("em",null,"foo bar baz")," to ",e.createElement("em",null,"[foo,bar,baz]"),"."),sr=e.createElement("span",null,"What part of the split string to you want to use? ",e.createElement("strong",null,"Example:")," ",e.createElement("em",null,"2")," selects ",e.createElement("em",null,"bar")," ","from ",e.createElement("em",null,"foo bar baz")," when split by whitespace."),ir=v||C.split_by===""||C.index===void 0||C.index<1||!t;return e.createElement("div",null,e.createElement(o.Input,{type:"text",id:"split_by",label:"Split by",labelClassName:"col-md-2",wrapperClassName:"col-md-10",defaultValue:C.split_by,onChange:J("split_by"),required:!0,help:ar}),e.createElement(o.Input,{type:"number",id:"index",label:"Target index",labelClassName:"col-md-2",wrapperClassName:"col-md-10",defaultValue:C.index,onChange:J("index"),min:"1",required:!0,help:sr}),e.createElement(o.Row,null,e.createElement(o.Col,{mdOffset:2,md:10},e.createElement(o.Button,{bsStyle:"info",onClick:or,disabled:ir},v?e.createElement(y.JO,{name:"spinner",spin:!0}):"Try"))))};xe.propTypes={configuration:s().object.isRequired,exampleMessage:s().string,onChange:s().func.isRequired,onExtractorPreviewLoad:s().func.isRequired},xe.defaultProps={exampleMessage:void 0};const Wt=xe,$t=Ue()({displayName:"SubstringExtractorConfiguration",propTypes:{configuration:s().object.isRequired,exampleMessage:s().string,onChange:s().func.isRequired,onExtractorPreviewLoad:s().func.isRequired},getInitialState(){return{trying:!1,configuration:this._getEffectiveConfiguration(this.props.configuration)}},componentDidMount(){this.props.onChange(this.state.configuration)},UNSAFE_componentWillReceiveProps(n){this.setState({configuration:this._getEffectiveConfiguration(n.configuration)})},DEFAULT_CONFIGURATION:{begin_index:0,end_index:1},_getEffectiveConfiguration(n){return h.Z.getEffectiveConfiguration(this.DEFAULT_CONFIGURATION,n)},_onChange(n){return t=>{this.props.onExtractorPreviewLoad(void 0);const r=this.state.configuration;r[n]=u.ZP.getValueFromInput(t.target),this.props.onChange(r)}},_verifySubstringInputs(){const n=this.beginIndex.getInputDOMNode(),t=this.endIndex.getInputDOMNode();(this.state.configuration.begin_index===void 0||this.state.configuration.begin_index<0)&&(n.value=0,this._onChange("begin_index")({target:n})),(this.state.configuration.end_index===void 0||this.state.configuration.end_index<0)&&(t.value=0,this._onChange("end_index")({target:t})),this.state.configuration.begin_index>this.state.configuration.end_index&&(n.value=this.state.configuration.end_index,this._onChange("begin_index")({target:n}))},_onTryClick(){if(this.setState({trying:!0}),this._verifySubstringInputs(),this.state.configuration.begin_index===this.state.configuration.end_index)this.props.onExtractorPreviewLoad(""),this.setState({trying:!1});else{const n=E.Z.testSubstring(this.state.configuration.begin_index,this.state.configuration.end_index,this.props.exampleMessage);n.then(t=>{if(!t.successful){H.Z.warning("We were not able to run the substring extraction. Please check index boundaries.");return}this.props.onExtractorPreviewLoad(e.createElement("samp",null,t.cut))}),n.finally(()=>this.setState({trying:!1}))}},_isTryButtonDisabled(){const{configuration:n}=this.state;return this.state.trying||n.begin_index===void 0||n.begin_index<0||n.end_index===void 0||n.end_index<0||!this.props.exampleMessage},render(){const n=e.createElement("span",null,"Where to end extracting. (Exclusive)"," ",e.createElement("strong",null,"Example:")," ",e.createElement("em",null,"1,5")," cuts ",e.createElement("em",null,"love")," from the string ",e.createElement("em",null,"ilovelogs"),".");return e.createElement("div",null,e.createElement(o.Input,{type:"number",ref:t=>{this.beginIndex=t},id:"begin_index",label:"Begin index",labelClassName:"col-md-2",wrapperClassName:"col-md-10",defaultValue:this.state.configuration.begin_index,onChange:this._onChange("begin_index"),min:"0",required:!0,help:"Character position from where to start extracting. (Inclusive)"}),e.createElement(o.Input,{type:"number",ref:t=>{this.endIndex=t},id:"end_index",label:"End index",labelClassName:"col-md-2",wrapperClassName:"col-md-10",defaultValue:this.state.configuration.end_index,onChange:this._onChange("end_index"),min:"0",required:!0,help:n}),e.createElement(o.Row,null,e.createElement(o.Col,{mdOffset:2,md:10},e.createElement(o.Button,{bsStyle:"info",onClick:this._onTryClick,disabled:this._isTryButtonDisabled()},this.state.trying?e.createElement(y.JO,{name:"spinner",spin:!0}):"Try"))))}});var jt=Object.defineProperty,Kt=(n,t,r)=>t in n?jt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,Y=(n,t,r)=>(Kt(n,typeof t!="symbol"?t+"":t,r),r);class be extends e.Component{constructor(){super(...arguments),Y(this,"state",{trying:!1,lookupTables:void 0}),Y(this,"_updateConfigValue",(t,r)=>{this.props.onExtractorPreviewLoad(void 0);const l=this.props.configuration;l[t]=r,this.props.onChange(l)}),Y(this,"_onChange",t=>r=>this._updateConfigValue(t,u.ZP.getValueFromInput(r.target))),Y(this,"_onSelect",t=>r=>this._updateConfigValue(t,r)),Y(this,"_onTryClick",()=>{this.setState({trying:!0});const t=E.Z.testLookupTable(this.props.configuration.lookup_table_name,this.props.exampleMessage);t.then(r=>{if(r.error){H.Z.warning(`We were not able to run the lookup: ${r.error_message}`);return}r.empty?this.props.onExtractorPreviewLoad(`no lookup result for "${r.key}"`):this.props.onExtractorPreviewLoad(r.value)}),t.finally(()=>this.setState({trying:!1}))}),Y(this,"_isTryButtonDisabled",()=>this.state.trying||!this.props.configuration.lookup_table_name||!this.props.exampleMessage)}componentDidMount(){Ze.H.searchPaginated(1,1e4,null).then(t=>{this.setState({lookupTables:t.lookup_tables})})}render(){if(!this.state.lookupTables)return e.createElement(y.$j,null);const t=this.state.lookupTables.map(l=>({label:l.title,value:l.name})),r=e.createElement("span",null,"Lookup tables can be created ",e.createElement(Le.r,{to:we.ZP.SYSTEM.LOOKUPTABLES.OVERVIEW},"here"),".");return e.createElement("div",null,e.createElement(o.Input,{id:"lookup_table_name",label:"Lookup Table",labelClassName:"col-md-2",wrapperClassName:"col-md-10",help:r},e.createElement(o.Row,{className:"row-sm"},e.createElement(o.Col,{md:11},e.createElement(y.Ph,{placeholder:"Select a lookup table",clearable:!1,options:t,matchProp:"label",onChange:this._onSelect("lookup_table_name"),value:this.props.configuration.lookup_table_name})),e.createElement(o.Col,{md:1,className:"text-right"},e.createElement(o.Button,{bsStyle:"info",onClick:this._onTryClick,disabled:this._isTryButtonDisabled()},this.state.trying?e.createElement(y.JO,{name:"spinner",spin:!0}):"Try")))))}}Y(be,"propTypes",{configuration:s().object.isRequired,exampleMessage:s().string,onChange:s().func.isRequired,onExtractorPreviewLoad:s().func.isRequired}),Y(be,"defaultProps",{exampleMessage:""});const Gt=be;var Vt=Object.defineProperty,Ht=(n,t,r)=>t in n?Vt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,Pe=(n,t,r)=>(Ht(n,typeof t!="symbol"?t+"":t,r),r);class je extends e.Component{constructor(){super(...arguments),Pe(this,"state",{extractorPreview:void 0}),Pe(this,"_onExtractorPreviewLoad",t=>{this.setState({extractorPreview:t})})}render(){let t;switch(this.props.extractorType){case h.Z.ExtractorTypes.COPY_INPUT:t=e.createElement(gt,null);break;case h.Z.ExtractorTypes.GROK:t=e.createElement(St,{configuration:this.props.configuration,exampleMessage:this.props.exampleMessage,onChange:this.props.onChange,onExtractorPreviewLoad:this._onExtractorPreviewLoad});break;case h.Z.ExtractorTypes.JSON:t=e.createElement(Nt,{configuration:this.props.configuration,exampleMessage:this.props.exampleMessage,onChange:this.props.onChange,onExtractorPreviewLoad:this._onExtractorPreviewLoad});break;case h.Z.ExtractorTypes.REGEX:t=e.createElement(Zt,{configuration:this.props.configuration,exampleMessage:this.props.exampleMessage,onChange:this.props.onChange,onExtractorPreviewLoad:this._onExtractorPreviewLoad});break;case h.Z.ExtractorTypes.REGEX_REPLACE:t=e.createElement(Ut,{configuration:this.props.configuration,exampleMessage:this.props.exampleMessage,onChange:this.props.onChange,onExtractorPreviewLoad:this._onExtractorPreviewLoad});break;case h.Z.ExtractorTypes.SUBSTRING:t=e.createElement($t,{configuration:this.props.configuration,exampleMessage:this.props.exampleMessage,onChange:this.props.onChange,onExtractorPreviewLoad:this._onExtractorPreviewLoad});break;case h.Z.ExtractorTypes.SPLIT_AND_INDEX:t=e.createElement(Wt,{configuration:this.props.configuration,exampleMessage:this.props.exampleMessage,onChange:this.props.onChange,onExtractorPreviewLoad:this._onExtractorPreviewLoad});break;case h.Z.ExtractorTypes.LOOKUP_TABLE:t=e.createElement(Gt,{configuration:this.props.configuration,exampleMessage:this.props.exampleMessage,onChange:this.props.onChange,onExtractorPreviewLoad:this._onExtractorPreviewLoad});break;default:console.warn(`Unsupported extractor type ${this.props.extractorType}`)}let r;return this.state.extractorPreview!==void 0&&(r=e.createElement("div",{className:"form-group"},e.createElement(o.Col,{md:10,mdOffset:2},e.createElement(o.Panel,{header:"Extractor preview",bsStyle:"info"},this.state.extractorPreview===""?e.createElement("em",null,"Nothing will be extracted"):this.state.extractorPreview)))),e.createElement("div",null,t,r)}}Pe(je,"propTypes",{extractorType:s().oneOf(h.Z.EXTRACTOR_TYPES).isRequired,configuration:s().object.isRequired,onChange:s().func.isRequired,exampleMessage:s().string});const Jt=je;var Te=a("J6y4/h8P"),zt=a("tEZsXsVa"),Xt=Object.defineProperty,Yt=(n,t,r)=>t in n?Xt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,Re=(n,t,r)=>(Yt(n,typeof t!="symbol"?t+"":t,r),r);const qt=(0,Te.default)(o.Well)(({theme:n})=>(0,Te.css)`
  margin-bottom: 5px;
  font-family: ${n.fonts.family.monospace};
  font-size: ${n.fonts.size.body};
  white-space: pre-wrap;
  word-wrap: break-word;
`),Qt=Te.default.div`
  margin-top: 15px;
  margin-bottom: 12px;
`;class Oe extends e.Component{constructor(){super(...arguments),Re(this,"_onExampleLoad",t=>{const{field:r,onExampleLoad:l}=this.props,C=t.fields[r];l(C)})}render(){const{example:t,field:r}=this.props,l=e.createElement("span",{id:"xtrc-original-example",style:{display:"none"}},t);let C;return t?C=e.createElement(qt,{bsSize:"small"},e.createElement("span",{id:"xtrc-example"},t)):C=e.createElement(Qt,{className:"alert alert-warning"},"Could not load an example of field \u2018",r,"\u2019. It is not possible to test the extractor before updating it."),e.createElement("div",null,l,C,e.createElement(zt.Z,{onMessageLoaded:this._onExampleLoad}))}}Re(Oe,"propTypes",{field:s().string.isRequired,example:s().string,onExampleLoad:s().func}),Re(Oe,"defaultProps",{example:"",onExampleLoad:()=>{}});const er=Oe;var tr=Object.defineProperty,rr=(n,t,r)=>t in n?tr(n,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[t]=r,Z=(n,t,r)=>(rr(n,typeof t!="symbol"?t+"":t,r),r);class Ie extends e.Component{constructor(t){super(t),Z(this,"_updateExampleMessage",r=>{this.setState({exampleMessage:r})}),Z(this,"_onTargetFieldChange",r=>{const{value:l}=r.target,C=l.replace(/[^\w\d_]/g,"");l!==C&&(this.targetField.getInputDOMNode().value=C),this._onFieldChange("target_field")(r)}),Z(this,"_onFieldChange",r=>l=>{const C={},{updatedExtractor:d}=this.state;d[r]=u.ZP.getValueFromInput(l.target),C.updatedExtractor=d,r==="condition_value"&&(C.conditionTestResult=void 0),this.setState(C)}),Z(this,"_onConfigurationChange",r=>{const{updatedExtractor:l}=this.state;l.extractor_config=r,this.setState({updatedExtractor:l})}),Z(this,"_onConverterChange",(r,l)=>{const{updatedExtractor:C}=this.state,d=C.converters.filter(v=>v.type===r)[0];if(d){const v=C.converters.indexOf(d);C.converters.splice(v,1)}l&&C.converters.push(l),this.setState({updatedExtractor:C})}),Z(this,"_testCondition",()=>{const{exampleMessage:r,updatedExtractor:l}=this.state;(l.condition_type==="string"?E.Z.testContainsString:E.Z.testRegex)(l.condition_value,r).then(v=>this.setState({conditionTestResult:v.matched}))}),Z(this,"_tryButtonDisabled",()=>{const{updatedExtractor:r,exampleMessage:l}=this.state;return r.condition_value===""||r.condition_value===void 0||!l}),Z(this,"_getExtractorConditionControls",()=>{const{conditionTestResult:r,updatedExtractor:l}=this.state;if(!l.condition_type||l.condition_type==="none")return e.createElement("div",null);let C,d;l.condition_type==="string"?(C="Field contains string",d="Type a string that the field should contain in order to attempt the extraction."):(C="Field matches regular expression",d="Type a regular expression that the field should contain in order to attempt the extraction.");let v;return r===!0?(v="success",d="Matches! Extractor would run against this example."):r===!1&&(v="error",d="Does not match! Extractor would not run."),e.createElement("div",null,e.createElement(o.Input,{id:"condition_value",label:C,bsStyle:v,labelClassName:"col-md-2",wrapperClassName:"col-md-10",help:d},e.createElement(o.Row,{className:"row-sm"},e.createElement(o.Col,{md:11},e.createElement("input",{type:"text",id:"condition_value",className:"form-control",defaultValue:l.condition_value,onChange:this._onFieldChange("condition_value"),required:!0})),e.createElement(o.Col,{md:1,className:"text-right"},e.createElement(o.Button,{bsStyle:"info",onClick:this._testCondition,disabled:this._tryButtonDisabled()},"Try")))))}),Z(this,"_saveExtractor",r=>{const{inputId:l,onSave:C}=this.props,{updatedExtractor:d}=this.state;r.preventDefault(),R.e.save.triggerPromise(l,d).then(()=>C())}),Z(this,"_staticField",(r,l)=>e.createElement(o.FormGroup,null,e.createElement(o.Col,{componentClass:o.ControlLabel,md:2},r),e.createElement(o.Col,{md:10},e.createElement(o.FormControl.Static,null,l)))),this.state={updatedExtractor:t.extractor,conditionTestResult:void 0,exampleMessage:t.exampleMessage}}UNSAFE_componentWillReceiveProps(t){const{exampleMessage:r}=this.props;r!==t.exampleMessage&&this._updateExampleMessage(t.exampleMessage)}render(){const{updatedExtractor:t,exampleMessage:r}=this.state,{action:l}=this.props,C="Extracting only from messages that match a certain condition helps you avoiding wrong or unnecessary extractions and can also save CPU resources.",d=e.createElement("span",null,"Do you want to copy or cut from source? You cannot use the cutting feature on standard fields like"," ",e.createElement("em",null,"message")," and ",e.createElement("em",null,"source"),"."),v=e.createElement("span",null,"Choose a field name to store the extracted value. It can only contain ",e.createElement("b",null,"alphanumeric characters and underscores"),". Example: ",e.createElement("em",null,"http_response_code"),".");let oe;return t.type!==h.Z.ExtractorTypes.GROK&&t.type!==h.Z.ExtractorTypes.JSON&&(oe=e.createElement(o.Input,{type:"text",ref:J=>{this.targetField=J},id:"target_field",label:"Store as field",defaultValue:t.target_field,labelClassName:"col-md-2",wrapperClassName:"col-md-10",onChange:this._onTargetFieldChange,required:!0,help:v})),e.createElement("div",null,e.createElement(o.Row,{className:"content extractor-list"},e.createElement(o.Col,{md:12},e.createElement("h2",null,"Example message"),e.createElement(o.Row,{style:{marginTop:5}},e.createElement(o.Col,{md:12},e.createElement(er,{field:t.source_field,example:r,onExampleLoad:this._updateExampleMessage}))),e.createElement("h2",null,"Extractor configuration"),e.createElement(o.Row,null,e.createElement(o.Col,{md:8},e.createElement("form",{className:"extractor-form form-horizontal",method:"POST",onSubmit:this._saveExtractor},this._staticField("Extractor type",h.Z.getReadableExtractorTypeName(t.type)),this._staticField("Source field",t.source_field),e.createElement(Jt,{extractorType:t.type,configuration:t.extractor_config,onChange:this._onConfigurationChange,exampleMessage:r}),e.createElement(o.Input,{id:"condition-type",label:"Condition",labelClassName:"col-md-2",wrapperClassName:"col-md-10",help:C},e.createElement("span",null,e.createElement("div",{className:"radio"},e.createElement("label",{htmlFor:"condition_type_none"},e.createElement("input",{type:"radio",name:"condition_type",id:"condition_type_none",value:"none",onChange:this._onFieldChange("condition_type"),defaultChecked:!t.condition_type||t.condition_type==="none"}),"Always try to extract")),e.createElement("div",{className:"radio"},e.createElement("label",{htmlFor:"condition_type_string"},e.createElement("input",{type:"radio",name:"condition_type",id:"condition_type_string",value:"string",onChange:this._onFieldChange("condition_type"),defaultChecked:t.condition_type==="string"}),"Only attempt extraction if field contains string")),e.createElement("div",{className:"radio"},e.createElement("label",{htmlFor:"condition_type_regex"},e.createElement("input",{type:"radio",name:"condition_type",id:"condition_type_regex",value:"regex",onChange:this._onFieldChange("condition_type"),defaultChecked:t.condition_type==="regex"}),"Only attempt extraction if field matches regular expression")))),this._getExtractorConditionControls(),oe,e.createElement(o.Input,{id:"extraction-strategy",label:"Extraction strategy",labelClassName:"col-md-2",wrapperClassName:"col-md-10",help:d},e.createElement("span",null,e.createElement("label",{className:"radio-inline",htmlFor:"cursor_strategy_copy"},e.createElement("input",{type:"radio",name:"cursor_strategy",id:"cursor_strategy_copy",value:"copy",onChange:this._onFieldChange("cursor_strategy"),defaultChecked:!t.cursor_strategy||t.cursor_strategy==="copy"}),"Copy"),e.createElement("label",{className:"radio-inline",htmlFor:"cursor_strategy_cut"},e.createElement("input",{type:"radio",name:"cursor_strategy",id:"cursor_strategy_cut",value:"cut",onChange:this._onFieldChange("cursor_strategy"),defaultChecked:t.cursor_strategy==="cut"}),"Cut"))),e.createElement(o.Input,{type:"text",id:"title",label:"Extractor title",defaultValue:t.title,labelClassName:"col-md-2",wrapperClassName:"col-md-10",onChange:this._onFieldChange("title"),required:!0,help:"A descriptive name for this extractor."}),e.createElement("div",{style:{marginBottom:20}},e.createElement(ut,{extractorType:t.type,converters:t.converters,onChange:this._onConverterChange})),e.createElement(o.Row,null,e.createElement(o.Col,{mdOffset:2,md:10},e.createElement(o.Button,{type:"submit",bsStyle:"success"},l==="create"?"Create extractor":"Update extractor")))))))))}}Z(Ie,"propTypes",{action:s().oneOf(["create","edit"]).isRequired,extractor:s().object.isRequired,inputId:s().string.isRequired,exampleMessage:s().string,onSave:s().func.isRequired}),Z(Ie,"defaultProps",{exampleMessage:void 0});const nr=Ie},tEZsXsVa:(L,A,a)=>{a.d(A,{Z:()=>p});var x=a("Z7aTuO5B"),s=a("ii0bleBb"),e=a.n(s),o=a("J6y4/h8P"),h=a("eOHTbxJi"),u=a("/GOzvPf6"),E=a("/7OuCFNo"),R=a("uZqmR+ju");const y=(0,o.default)(u.Ow)`
  margin-top: 10px;
`,c=({loadMessage:g,children:m,loading:f})=>{const P=(0,E.Z)();return x.createElement("div",null,x.createElement("form",{className:"form-inline message-loader-form",onSubmit:g},m,x.createElement(y,{submitButtonText:"Load message",isSubmitting:f,submitLoadingText:"Loading message...",isAsyncSubmit:!0,displayCancel:!0,onCancel:()=>P.goBack()})))},_=(g,m,f)=>{const[P,I]=(0,x.useState)(!1),O=(0,x.useCallback)((N,V)=>{if(N===""||V==="")return;I(!0);const F=h.q.loadMessage(V,N);F.then(q=>f(q)),F.finally(()=>I(!1))},[f]);return(0,x.useEffect)(()=>{g&&m&&O(g,m)},[g,m,O]),[P,O]},i=({hidden:g,hideText:m,onMessageLoaded:f,messageId:P,index:I})=>{const[O,N]=(0,x.useState)(g),[V,F]=(0,x.useState)(P),q=(0,x.useCallback)(U=>F(U.target.value),[]),W=(0,x.useRef)(),[B,ae]=(0,x.useState)(I),le=(0,x.useCallback)(U=>ae(U.target.value),[]),[ce,z]=_(P,I,f),$=(0,x.useCallback)(U=>{U!=null&&U.preventDefault&&U.preventDefault(),z(V,B)},[B,z,V]),Q=(0,x.useCallback)(()=>{N(!O)},[O]);return(0,x.useEffect)(()=>{!O&&W.current&&W.current.focus()},[O]),x.createElement("div",{className:"message-loader"},m||x.createElement("p",null,"Wrong example? ",x.createElement(R.Button,{bsSize:"sm",onClick:Q},"Load another message")),O||x.createElement(c,{loading:ce,loadMessage:$},x.createElement("input",{ref:W,type:"text",className:"form-control message-id-input",placeholder:"Message ID",required:!0,value:V,onChange:q}),x.createElement("input",{type:"text",className:"form-control",placeholder:"Index",required:!0,value:B,onChange:le})))};i.propTypes={hidden:e().bool,hideText:e().bool,onMessageLoaded:e().func.isRequired,messageId:e().string,index:e().string},i.defaultProps={hidden:!0,hideText:!1,messageId:"",index:""};const p=i},"5chL1ePP":(L,A,a)=>{a.d(A,{Z:()=>U});var x=a("ii0bleBb"),s=a.n(x),e=a("Z7aTuO5B"),o=a("uZqmR+ju"),h=a("+KM7MH1U"),u=a.n(h),E=a("dFpwyWHg"),R=a.n(E),y=a("C2ikvoS0"),c=a.n(y),_=a("1IntWRSu"),i=a.n(_),p=a("8nGWeFnd"),g=a.n(p),m=a("TeAcaicX"),f=a.n(m),P=a("eE3+5goe"),I=a.n(P),O=a("WXKdeTMX"),N={};N.styleTagTransform=I(),N.setAttributes=g(),N.insert=i().bind(null,"head"),N.domAPI=c(),N.insertStyleElement=f();var V=R()(O.Z,N);const F=O.Z&&O.Z.locals?O.Z.locals:void 0;var q=Object.defineProperty,W=(M,T,b)=>T in M?q(M,T,{enumerable:!0,configurable:!0,writable:!0,value:b}):M[T]=b,B=(M,T,b)=>(W(M,typeof T!="symbol"?T+"":T,b),b);class ae extends e.Component{constructor(T){super(T),B(this,"shownListItems",[]),B(this,"_onPatternFilterChange",b=>{this.setState({patternFilter:b.target.value,activeListItem:-1})}),B(this,"_onPatternFilterKeyDown",b=>{const{addToPattern:k}=this.props,{activeListItem:S}=this.state,j=40,K=38,ee=13,D=this.shownListItems[S];let w=0;const se=document.getElementById("list-item-0");let G,te;switch(b.keyCode){case j:if(w=S+1,S>=this.shownListItems.length)return;G=document.getElementById(`list-item-${w}`),te=G.parentElement,te.scrollTop=G.offsetTop-se.offsetTop,this.setState({activeListItem:w}),b.preventDefault();break;case K:if(w=S-1,w<0)return;G=document.getElementById(`list-item-${w}`),te=G.parentElement,te.scrollTop=G.offsetTop-se.offsetTop,this.setState({activeListItem:w}),b.preventDefault();break;case ee:D&&k(D),b.preventDefault();break;default:break}}),this.state={patternFilter:"",activeListItem:-1}}shouldComponentUpdate(T,b){const{patterns:k}=this.props,{patternFilter:S,activeListItem:j}=this.state;return!(u()(T.patterns,k)&&S===b.patternFilter&&j===b.activeListItem)}render(){const{activeListItem:T,patternFilter:b}=this.state,{addToPattern:k,patterns:S}=this.props;let j,K;try{j=RegExp(b,"i")}catch(D){K=D==null?void 0:D.message}this.shownListItems=[];let ee=[];return K||(ee=S.filter(D=>j.test(D.name)).map((D,w)=>{const se=w===T;return this.shownListItems.push(D.name),e.createElement(o.ListGroupItem,{id:`list-item-${w}`,header:D.name,bsStyle:se?"info":void 0,onKeyDown:this._onPatternFilterKeyDown,key:D.name},e.createElement("span",{className:F.patternDisplay},D.pattern),e.createElement("span",{className:F.addButton},e.createElement(o.Button,{bsSize:"xsmall",bsStyle:"primary",onClick:()=>{k(D.name)}},"Add")))})),e.createElement(e.Fragment,null,e.createElement(o.Input,{type:"text",id:"pattern-selector",label:"Filter pattern",onChange:this._onPatternFilterChange,autoComplete:"off",formGroupClassName:F.filterFormGroup,onKeyDown:this._onPatternFilterKeyDown,value:b,error:K}),!K&&e.createElement(o.ListGroup,{bsClass:F.resultList},ee))}}B(ae,"propTypes",{addToPattern:s().func.isRequired,patterns:s().array.isRequired});const le=ae;var ce=Object.defineProperty,z=(M,T,b)=>T in M?ce(M,T,{enumerable:!0,configurable:!0,writable:!0,value:b}):M[T]=b,$=(M,T,b)=>(z(M,typeof T!="symbol"?T+"":T,b),b);class Q extends e.Component{constructor(){super(...arguments),$(this,"shownListItems",[]),$(this,"_onPatternChange",T=>{const{onPatternChange:b}=this.props;b(T.target.value)}),$(this,"_addToPattern",T=>{const{pattern:b,onPatternChange:k}=this.props,S=this.patternInput.getInputDOMNode().selectionStart||b.length,j=`${b.slice(0,S)}%{${T}}${b.slice(S)}`;k(j)})}render(){const{className:T,patterns:b,pattern:k}=this.props;return this.shownListItems=[],e.createElement(o.Row,{className:T},e.createElement(o.Col,{sm:8},e.createElement(o.Input,{ref:S=>{this.patternInput=S},type:"textarea",id:"pattern-input",label:"Pattern",help:"The pattern which will match the log line e.g: '%{IP:client}' or '.*?'",rows:9,onChange:this._onPatternChange,value:k,required:!0})),e.createElement(o.Col,{sm:4},e.createElement(le,{addToPattern:this._addToPattern,patterns:b})))}}$(Q,"propTypes",{pattern:s().string,patterns:s().array,onPatternChange:s().func,className:s().string}),$(Q,"defaultProps",{pattern:"",patterns:[],onPatternChange:()=>{},className:""});const U=Q},mr1MxJ4D:(L,A,a)=>{a.d(A,{Z:()=>h});var x=a("9oVghaOd"),s=a.n(x),e=a("0+7ljD5O");const h={formatMessageSummary(u){const{message:E}=u;return this.formatMessage(E._id,u.index,E,E,u.highlight_ranges,u.decoration_stats)},formatResultMessage(u){const{message:E}=u;return this.formatMessage(E.id,u.index,E,E.fields,u.highlight_ranges,u.decoration_stats)},formatMessage(u,E,R,y,c,_){const i=e.Z.filterFields(y);return{id:u,timestamp:s()(R.timestamp).unix(),filtered_fields:i,formatted_fields:i,fields:y,index:E,source_node_id:y.gl2_source_node,source_input_id:y.gl2_source_input,stream_ids:R.streams,highlight_ranges:c,decoration_stats:_}}}},N6x7vnl1:(L,A,a)=>{a.d(A,{Z:()=>o});var x=a("Z7aTuO5B"),s=a("/7OuCFNo");const o=h=>u=>{const E=(0,s.Z)();return x.createElement(h,{...u,history:E})}},c9JM82dZ:(L,A,a)=>{a.d(A,{Z:()=>o});var x=a("Z7aTuO5B"),s=a("yAXMqwrl");const o=h=>u=>{const E=(0,s.useParams)();return x.createElement(h,{...u,params:E})}},"8UzJguce":(L,A,a)=>{a.d(A,{F:()=>_,e:()=>y});var x=a("JnTtTRmZ"),s=a.n(x),e=a("U1Iufsob"),o=a("eFxcQyPT"),h=a("xS8q27Jr"),u=a("MdYBRjRJ"),E=a("jAGDuYSC"),R=a("IA3Ku5lS");const y=(0,R.ei)("core.Extractors",()=>s().createActions({list:{asyncResult:!0},get:{asyncResult:!0},create:{asyncResult:!0},save:{asyncResult:!0},update:{asyncResult:!0},delete:{asyncResult:!0},order:{asyncResult:!0},import:{}}));function c(i){const p=i.condition_type&&i.condition_type!=="none"?i.condition_value:"";return{title:i.title,cursor_strategy:i.cursor_strategy||"copy",source_field:i.source_field,target_field:i.target_field,extractor_type:i.type||i.extractor_type,extractor_config:i.extractor_config,converters:i.converters,condition_type:i.condition_type||"none",condition_value:p,order:i.order}}const _=(0,R.dS)("core.Extractors",()=>s().createStore({listenables:[y],sourceUrl:"/system/inputs/",extractors:void 0,extractor:void 0,init(){this.trigger({extractors:this.extractors,extractor:this.extractor})},list(i){const p=(0,o.ZP)("GET",u.DC(u.em(this.sourceUrl,i,"extractors")));p.then(g=>{this.extractors=g.extractors,this.trigger({extractors:this.extractors})}),y.list.promise(p)},new(i,p){if(h.Z.EXTRACTOR_TYPES.indexOf(i)===-1)throw new Error(`Invalid extractor type provided: ${i}`);return{type:i,source_field:p,converters:[],extractor_config:{},target_field:""}},get(i,p){const g=(0,o.ZP)("GET",u.DC(u.em(this.sourceUrl,i,"extractors",p)));g.then(m=>{this.extractor=m,this.trigger({extractor:this.extractor})}),y.get.promise(g)},save(i,p){let g;p.id?g=this.update(i,p,!0):g=this.create(i,p,!0),y.save.promise(g)},_silentExtractorCreate(i,p){const g=u.DC(e.Z.ExtractorsController.create(i).url);return(0,o.ZP)("POST",g,c(p))},create(i,p,g){const m=this._silentExtractorCreate(i,p);return m.then(()=>{E.Z.success(`Extractor ${p.title} created successfully`),this.extractor&&y.get.triggerPromise(i,p.id)}).catch(f=>{E.Z.error(`Creating extractor failed: ${f}`,"Could not create extractor")}),g||y.create.promise(m),m},update(i,p,g){const m=u.DC(e.Z.ExtractorsController.update(i,p.id).url),f=(0,o.ZP)("PUT",m,c(p));return f.then(()=>{E.Z.success(`Extractor "${p.title}" updated successfully`),this.extractor&&y.get.triggerPromise(i,p.id)}).catch(P=>{E.Z.error(`Updating extractor failed: ${P}`,"Could not update extractor")}),g||y.update.promise(f),f},delete(i,p){const g=u.DC(e.Z.ExtractorsController.delete(i,p.id).url),m=(0,o.ZP)("DELETE",g);m.then(()=>{E.Z.success(`Extractor "${p.title}" deleted successfully`),this.extractors&&y.list.triggerPromise(i)}).catch(f=>{E.Z.error(`Deleting extractor failed: ${f}`,`Could not delete extractor ${p.title}`)}),y.delete.promise(m)},order(i,p){const g=u.DC(e.Z.ExtractorsController.order(i).url),m={};p.forEach((P,I)=>{m[I]=P.id});const f=(0,o.ZP)("POST",g,{order:m});f.then(()=>{E.Z.success("Extractor positions updated successfully"),this.extractors&&y.list.triggerPromise(i)}),f.catch(P=>{E.Z.error(`Changing extractor positions failed: ${P}`,"Could not update extractor positions")}),y.order.promise(f)},import(i,p){let g=0,m=0;const f=[];p.forEach(P=>{const I=this._silentExtractorCreate(i,P);I.then(()=>{g+=1}).catch(()=>{m+=1}),f.push(I)}),Promise.allSettled(f).then(()=>{m===0?E.Z.success(`Import results: ${g} extractor(s) imported.`,"Import operation successful"):E.Z.warning(`Import results: ${g} extractor(s) imported, ${m} error(s).`,"Import operation completed")})}}))},ZYJ7aiK3:(L,A,a)=>{a.d(A,{o:()=>y});var x=a("JnTtTRmZ"),s=a.n(x),e=a("eFxcQyPT"),o=a("gyRmhZSW"),h=a("U1Iufsob"),u=a("MdYBRjRJ"),E=a("jAGDuYSC"),R=a("IA3Ku5lS");const y=(0,R.dS)("core.GrokPatterns",()=>s().createStore({URL:(0,u.DC)("/system/grok"),loadPatterns(c){const _=i=>{E.Z.error(`Loading Grok patterns failed with status: ${i.message}`,"Could not load Grok patterns")};return(0,e.ZP)("GET",this.URL).then(i=>{const{patterns:p}=i;return p.sort((g,m)=>g.name.toLowerCase().localeCompare(m.name.toLowerCase())),c(p),i},_)},searchPaginated(c,_,i){const p=(0,o.Z)(h.Z.GrokPatternsController.paginated().url,c,_,i);return(0,e.ZP)("GET",(0,u.DC)(p)).then(g=>{const m={count:g.count,total:g.total,page:g.page,perPage:g.per_page,query:i};return{patterns:g.patterns,pagination:m}}).catch(g=>{E.Z.error(`Loading patterns failed with status: ${g}`,"Could not load streams")})},testPattern(c,_,i){const p=m=>{let f=m.message;const P=m.additional.body;P&&P.message&&(f=m.additional.body.message),i(f)},g={grok_pattern:{name:c.name,pattern:c.pattern},sampleData:c.sampleData};(0,e.ZP)("POST",(0,u.DC)(h.Z.GrokPatternsController.test().url),g).then(m=>(_(m),m),p)},savePattern(c,_){const i=f=>{let P=f.message;const I=f.additional.body;I&&I.message&&(P=f.additional.body.message),E.Z.error(`Testing Grok pattern "${c.name}" failed with status: ${P}`,"Could not test Grok pattern")},p={id:c.id,pattern:c.pattern,name:c.name,content_pack:c.content_pack};let g=this.URL,m;c.id===""?m="POST":(g+=`/${c.id}`,m="PUT"),(0,e.ZP)(m,g,p).then(f=>{_();const P=c.id===""?"created":"updated",I=`Grok pattern "${c.name}" successfully ${P}`;return E.Z.success(I),f},i)},deletePattern(c,_){const i=p=>{E.Z.error(`Deleting Grok pattern "${c.name}" failed with status: ${p.message}`,"Could not delete Grok pattern")};(0,e.ZP)("DELETE",`${this.URL}/${c.id}`).then(p=>(_(),E.Z.success(`Grok pattern "${c.name}" successfully deleted`),p),i)},bulkImport(c,_){const i=g=>{let m=g.message;const f=g.additional.body;if(f&&f.validation_errors&&f.validation_errors._){m="";const P=f.validation_errors._;for(let I=0,O=P.length;I{a.d(A,{H:()=>R,m:()=>y});var x=a("JnTtTRmZ"),s=a.n(x),e=a("jAGDuYSC"),o=a("gyRmhZSW"),h=a("MdYBRjRJ"),u=a("eFxcQyPT"),E=a("IA3Ku5lS");const R=(0,E.ei)("core.LookupTables",()=>s().createActions({searchPaginated:{asyncResult:!0},reloadPage:{asyncResult:!0},get:{asyncResult:!0},create:{asyncResult:!0},delete:{asyncResult:!0},update:{asyncResult:!0},getErrors:{asyncResult:!0},lookup:{asyncResult:!0},purgeKey:{asyncResult:!0},purgeAll:{asyncResult:!0},validate:{asyncResult:!0}})),y=(0,E.dS)("core.LookupTables",()=>s().createStore({listenables:[R],pagination:{page:1,per_page:10,total:0,count:0,query:null},errorStates:{tables:{},caches:{},dataAdapters:{}},table:null,cache:null,dataAdapter:null,tables:null,caches:null,dataAdapters:null,lookupResult:null,validationErrors:{},getInitialState(){return this.getState()},getState(){return{errorStates:this.errorStates,table:this.table,cache:this.cache,dataAdapter:this.dataAdapter,tables:this.tables,caches:this.caches,dataAdapters:this.dataAdapters,lookupResult:this.lookupResult,validationErrors:this.validationErrors,pagination:this.pagination}},propagateChanges(){this.trigger(this.getState())},reloadPage(){const c=this.searchPaginated(this.pagination.page,this.pagination.per_page,this.pagination.query);return R.reloadPage.promise(c),c},searchPaginated(c,_,i=null,p=!0){const g=this._url((0,o.Z)("tables",c,_,i,{resolve:p})),m=(0,u.ZP)("GET",g);return m.then(f=>{this.pagination={count:f.count,total:f.total,page:f.page,per_page:f.per_page,query:f.query},this.tables=f.lookup_tables,this.caches=f.caches,this.dataAdapters=f.data_adapters,this.propagateChanges()},this._errorHandler("Fetching lookup tables failed","Could not retrieve the lookup tables")),R.searchPaginated.promise(m),m},get(c){const _=this._url(`tables/${c}?resolve=true`),i=(0,u.ZP)("GET",_);return i.then(p=>{const g=p.lookup_tables[0];this.table=g,this.cache=p.caches[g.cache_id],this.dataAdapter=p.data_adapters[g.data_adapter_id],this.propagateChanges()},this._errorHandler(`Fetching lookup table ${c} failed`,"Could not retrieve lookup table")),R.get.promise(i),i},create(c){const _=this._url("tables"),i=(0,u.ZP)("POST",_,c);return i.catch(this._errorHandler("Creating lookup table failed",`Could not create lookup table "${c.name}"`)),R.create.promise(i),i},update(c){const _=this._url(`tables/${c.id}`),i=(0,u.ZP)("PUT",_,c);return i.catch(this._errorHandler("Updating lookup table failed",`Could not update lookup table "${c.name}"`)),R.update.promise(i),i},delete(c){const _=this._url(`tables/${c}`),i=(0,u.ZP)("DELETE",_);return i.catch(this._errorHandler("Deleting lookup table failed",`Could not delete lookup table "${c}"`)),R.delete.promise(i),i},getErrors(c,_,i){const p={};c&&(p.tables=c),_&&(p.caches=_),i&&(p.data_adapters=i);const g=(0,u.ZP)("POST",this._url("errorstates"),p);return g.then(m=>{this.errorStates={tables:m.tables||{},caches:m.caches||{},dataAdapters:m.data_adapters||{}},this.propagateChanges()},this._errorHandler("Fetching lookup table error state failed.","Could not error states")),R.getErrors.promise(g),g},lookup(c,_){const i=(0,u.ZP)("GET",this._url(`tables/${c}/query?key=${encodeURIComponent(_)}`));return i.then(p=>{this.lookupResult=p,this.propagateChanges()},this._errorHandler("Lookup failed",`Could not lookup value for key "${_}" in lookup table "${c}"`)),R.lookup.promise(i),i},purgeKey(c,_){const i=(0,u.ZP)("POST",this._urlClusterWise(`tables/${c.id}/purge?key=${encodeURIComponent(_)}`));return i.then(()=>{e.Z.success(`Purging cache key "${_}" for lookup table "${c.name}"`,"Success!")},this._errorHandler(`Could not purge cache for key "${_}" in lookup table "${c.name}"`,"Failed!")),R.purgeKey.promise(i),i},purgeAll(c){const _=(0,u.ZP)("POST",this._urlClusterWise(`tables/${c.id}/purge`));return _.then(()=>{e.Z.success(`Purging cache for lookup table "${c.name}"`,"Success!")},this._errorHandler(`Could not purge cache for lookup table "${c.name}"`,"Failed!")),R.purgeAll.promise(_),_},validate(c){const _=this._url("tables/validate"),i=(0,u.ZP)("POST",_,c);return i.then(p=>{this.validationErrors=p.errors,this.propagateChanges()},this._errorHandler("Lookup table validation failed",`Could not validate lookup table "${c.name}"`)),R.validate.promise(i),i},_errorHandler(c,_,i){return p=>{try{if(p.additional.body[0].message_template)return}catch{}let g;try{g=p.additional.body.message}catch{g=p.message}e.Z.error(`${c}: ${g}`,_),i&&i(p)}},_url(c){return(0,h.DC)(`/system/lookup/${c}`)},_urlClusterWise(c){return(0,h.DC)(`/cluster/system/lookup/${c}`)}}))},eOHTbxJi:(L,A,a)=>{a.d(A,{q:()=>c});var x=a("JnTtTRmZ"),s=a.n(x),e=a("eFxcQyPT"),o=a("mr1MxJ4D"),h=a("U1Iufsob"),u=a("MdYBRjRJ"),E=a("jAGDuYSC"),R=a("TJOheZRu"),y=a("IA3Ku5lS");const c=(0,y.ei)("core.Messages",()=>s().createActions({loadMessage:{asyncResult:!0},fieldTerms:{asyncResult:!0},loadRawMessage:{asyncResult:!0}})),_=(0,y.dS)("core.Messages",()=>s().createStore({listenables:[c],sourceUrl:"",getInitialState(){return{}},loadMessage(i,p){const{url:g}=h.Z.MessagesController.single(i.trim(),p.trim()),m=(0,e.ZP)("GET",u.DC(g)).then(f=>o.Z.formatResultMessage(f),f=>{E.Z.error(`Loading message information failed with status: ${f}`,"Could not load message information")});c.loadMessage.promise(m)},fieldTerms(i,p){const{url:g}=h.Z.MessagesController.analyze(i,encodeURIComponent(R.Z.stringify(p))),m=(0,e.ZP)("GET",u.DC(g)).then(f=>f.tokens,f=>{E.Z.error(`Loading field terms failed with status: ${f}`,"Could not load field terms.")});c.fieldTerms.promise(m)},loadRawMessage(i,p,g,m){const{url:f}=h.Z.MessagesController.parse(),P={message:i,remote_address:p,codec:g,configuration:m},I=(0,e.ZP)("POST",u.DC(f),P).then(O=>o.Z.formatResultMessage(O),O=>{if(O.additional&&O.additional.status===400){E.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}E.Z.error(`Loading raw message failed with status: ${O}`,"Could not load raw message")});c.loadRawMessage.promise(I)}}))}}]);})();

//# sourceMappingURL=1255d548-2065.e74b793f1df9b912dccc.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy