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

web-interface.assets.325e2d4b-5299.91c4d61edf1fd471af4e.js Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["325e2d4b-5299"],{pLLmkYy5:(e,t,a)=>{"use strict";a.d(t,{Z:()=>m});var l=a("Z7aTuO5B"),n=a("J6y4/h8P"),r=a("F9olzlTR"),o=a("EeAwn/0x"),s=a("0zTRKSqx"),i=a("XR6lEGGZ");const c=(0,n.default)(r.Si).withConfig({displayName:"PageNavigation__Container",componentId:"sc-1if5i40-0"})(["margin-bottom:10px;"]),u=(0,n.default)(r.zx).withConfig({displayName:"PageNavigation__StyledButton",componentId:"sc-1if5i40-1"})((e=>{let{theme:t}=e;return(0,n.css)(["font-family:",";font-size:",";&&&&{color:",";:hover,:focus{text-decoration:none;}:hover{","}&.active{color:",";"," :hover,:focus{","}}}"],t.fonts.family.navigation,t.fonts.size.navigation,t.colors.variant.darker.default,(0,i.RF)(t),t.colors.global.textDefault,(0,i.A7)(t),(0,i.A7)(t))}));u.displayName="Button";const m=e=>{let{items:t}=e;return l.createElement(c,null,t.map((e=>{let{path:t,title:a,permissions:n,exactPathMatch:r}=e;return t?l.createElement(s.AE,{permissions:null!=n?n:[],key:t},l.createElement(o.J,{to:t,relativeActive:!r},l.createElement(u,{bsStyle:"link"},l.createElement(i.ZP,null,a)))):null})))}},"ZfRiC/i0":(e,t,a)=>{"use strict";a.d(t,{Z:()=>o});var l=a("Z7aTuO5B"),n=a("3kMHuq+3");function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t{"use strict";a.d(t,{Z:()=>i});var l=a("Z7aTuO5B"),n=a("pLLmkYy5"),r=a("DeVaSktS"),o=a("F9olzlTR");const s=[{title:"Lookup Tables",path:r.ZP.SYSTEM.LOOKUPTABLES.OVERVIEW,exactPathMatch:!0},{title:"Caches",path:r.ZP.SYSTEM.LOOKUPTABLES.CACHES.OVERVIEW},{title:"Data Adapters",path:r.ZP.SYSTEM.LOOKUPTABLES.DATA_ADAPTERS.OVERVIEW}],i=()=>l.createElement(o.X2,null,l.createElement(n.Z,{items:s}))},mrzrHYG5:(e,t,a)=>{"use strict";a.d(t,{Ct:()=>et,rU:()=>ct,H7:()=>ot,HE:()=>mt,wP:()=>Et,M5:()=>Ge,s$:()=>kt,UG:()=>Rt,$G:()=>wt,$u:()=>Lt,pJ:()=>Dt,s8:()=>St,M_:()=>Ut,Rl:()=>$e,c1:()=>Ue,QX:()=>Oe,pP:()=>xe});var l=a("AztyBNMT"),n=a("ii0bleBb"),r=a.n(n),o=a("Z7aTuO5B"),s=a("v4zvXTw+"),i=a("+g3JwX3k"),c=a("F9olzlTR"),u=a("0zTRKSqx");const m=e=>{let{config:t,updateConfig:a,handleFormEvent:l,validationState:n,validationMessage:r}=e;const m=s.Z.isCloud(),d={IPINFO_STANDARD_LOCATION:"/etc/graylog/server/standard_location.mmdb",IPINFO_ASN:"/etc/graylog/server/asn.mmdb"},p=[{label:"IPinfo location database",value:"IPINFO_STANDARD_LOCATION"},{label:"IPinfo ASN database",value:"IPINFO_ASN"}];let h=[{label:"ASN database",value:"MAXMIND_ASN"},{label:"City database",value:"MAXMIND_CITY"},{label:"Country database",value:"MAXMIND_COUNTRY"}];m?h=p:h.concat(p);return o.createElement("fieldset",null,!m&&o.createElement(c.II,{type:"text",id:"path",name:"path",label:"File path",autoFocus:!0,required:!0,onChange:l,help:r("path","The path to the database file."),bsStyle:n("path"),value:t.path,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{id:"database-type-select",label:"Database type",required:!0,autoFocus:!0,help:"Select the type of the database file",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},o.createElement(u.Ph,{placeholder:"Select the type of database file",clearable:!1,options:h,matchProp:"label",onChange:e=>{const l=i.Z.clone(t);m&&(l.path=d[e]),l.database_type=e,a(l)},value:t.database_type})),o.createElement(u.AX,{label:"Refresh file",help:"If enabled, the database file is checked for modifications and refreshed when it changed on disk.",update:(e,l,n)=>{((e,l,n,r)=>{const o=i.Z.clone(t);o[r]=n?e:0,o[`${r}_unit`]=l,a(o)})(e,l,n,"check_interval")},value:t.check_interval,unit:t.check_interval_unit||"MINUTES",defaultEnabled:t.check_interval>0,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}))};m.propTypes={config:r().object.isRequired,updateConfig:r().func.isRequired,handleFormEvent:r().func.isRequired,validationState:r().func.isRequired,validationMessage:r().func.isRequired};const d=m;class p extends o.Component{render(){const{config:e}=this.props.dataAdapter;return o.createElement("dl",null,o.createElement("dt",null,"Database file path"),o.createElement("dd",null,e.path),o.createElement("dt",null,"Database type"),o.createElement("dd",null,{MAXMIND_ASN:"ASN database",MAXMIND_CITY:"City database",MAXMIND_COUNTRY:"Country database",IPINFO_STANDARD_LOCATION:"IPinfo location database",IPINFO_ASN:"IPinfo ASN database"}[e.database_type]),o.createElement("dt",null,"Check interval"),o.createElement("dd",null,o.createElement(u.j1,{value:e.check_interval,unit:e.check_interval_unit})))}}var h,g,E;h=p,g="propTypes",E={dataAdapter:r().object.isRequired},g in h?Object.defineProperty(h,g,{value:E,enumerable:!0,configurable:!0,writable:!0}):h[g]=E;const v=p;class b extends o.Component{render(){return o.createElement("div",null,o.createElement("p",null,"The GeoIP data adapter supports reading MaxMind's GeoIP2 databases."),o.createElement(c.bZ,{style:{marginBottom:10},bsStyle:"info"},o.createElement("h4",{style:{marginBottom:10}},"Limitations"),o.createElement("p",null,"Currently the ASN, city and country databases are supported."),o.createElement("p",null,"For support of additional database types, please visit our support channels.")),o.createElement("hr",null),o.createElement("h3",{style:{marginBottom:10}},"ASN database fields"),o.createElement("pre",null,'{\n    "as_number": 15169,\n    "as_organization": "Google LLC"\n}'),o.createElement("h3",{style:{marginBottom:10}},"Country database fields"),o.createElement("pre",null,'{\n    "continent": { "code": "NA", "geoname_id": 6255149, "names": { "en": "North America" } },\n    "country": { "geoname_id": 6252001, "iso_code": "US", "names": { "en": "United States" } },\n    "registered_country": { "geoname_id": 6252001, "iso_code": "US", "names": { } },\n    "represented_country": { "geoname_id": null, "iso_code": "US", "names": { } },\n    "traits": {\n      "ip_address": "8.8.8.8",\n      "is_anonymous_proxy": false,\n      "is_legitimate_proxy": false,\n      "is_satellite_provider": false,\n      "isp": null,\n      "organization": null,\n    }\n}'),o.createElement("h3",{style:{marginBottom:10}},"City database fields"),o.createElement("p",null,"In addition to the fields provided by the country database, the city database also includes the following fields:"),o.createElement("pre",null,'{\n    "city": { "geoname_id": 5375480, "names": { "en": "Mountain View" } },\n    "location": {\n      "accuracy_radius": 1000,\n      "average_income": null,\n      "latitude": 37.386,\n      "longitude": -122.0838,\n      "metro_code": 807,\n      "population_density": null,\n      "time_zone": "America/Los_Angeles"\n    },\n    "postal": { "code": "94035" },\n    "subdivisions": [ { "geoname_id": 5332921, "iso_code": "CA", "names": { "en": "California" } } ],\n}'),o.createElement("p",null,"For a complete documentation of the fields, please see MaxMind's ",o.createElement("a",{href:"http://maxmind.github.io/GeoIP2-java/",target:"_blank",rel:"noopener noreferrer"},"developer documentation")))}}const f=b;l.PluginStore.register(new l.PluginManifest({},{lookupTableAdapters:[{type:"maxmind_geoip",displayName:"Geo IP - MaxMind™ or IPinfo Databases",formComponent:d,summaryComponent:v,documentationComponent:f}]}));class y extends o.Component{render(){const{config:e}=this.props;return o.createElement("fieldset",null,o.createElement(c.II,{type:"text",id:"path",name:"path",label:"File path",autoFocus:!0,required:!0,onChange:this.props.handleFormEvent,help:this.props.validationMessage("path","The path to the CSV file."),bsStyle:this.props.validationState("path"),value:e.path,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"number",id:"check_interval",name:"check_interval",label:"Check interval",required:!0,onChange:this.props.handleFormEvent,help:"The interval to check if the CSV file needs a reload. (in seconds)",value:e.check_interval,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"separator",name:"separator",label:"Separator",required:!0,onChange:this.props.handleFormEvent,help:"The delimiter to use for separating entries.",value:e.separator,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"quotechar",name:"quotechar",label:"Quote character",required:!0,onChange:this.props.handleFormEvent,help:"The character to use for quoted elements.",value:e.quotechar,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"key_column",name:"key_column",label:"Key column",required:!0,onChange:this.props.handleFormEvent,help:"The column name that should be used for the key lookup.",value:e.key_column,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"value_column",name:"value_column",label:"Value column",required:!0,onChange:this.props.handleFormEvent,help:"The column name that should be used as the value for a key.",value:e.value_column,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"checkbox",id:"case_insensitive_lookup",name:"case_insensitive_lookup",label:"Allow case-insensitive lookups",checked:e.case_insensitive_lookup,onChange:this.props.handleFormEvent,help:"Enable if the key lookup should be case-insensitive.",wrapperClassName:"col-md-offset-3 col-md-9"}))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(y,"propTypes",{config:r().object.isRequired,updateConfig:r().func.isRequired,handleFormEvent:r().func.isRequired,validationState:r().func.isRequired,validationMessage:r().func.isRequired});const _=y;class C extends o.Component{render(){const{config:e}=this.props.dataAdapter;return o.createElement("dl",null,o.createElement("dt",null,"File path"),o.createElement("dd",null,e.path),o.createElement("dt",null,"Separator"),o.createElement("dd",null,o.createElement("code",null,e.separator)),o.createElement("dt",null,"Quote character"),o.createElement("dd",null,o.createElement("code",null,e.quotechar)),o.createElement("dt",null,"Key column"),o.createElement("dd",null,e.key_column),o.createElement("dt",null,"Value column"),o.createElement("dd",null,e.value_column),o.createElement("dt",null,"Check interval"),o.createElement("dd",null,e.check_interval," seconds"),o.createElement("dt",null,"Case-insensitive lookup"),o.createElement("dd",null,e.case_insensitive_lookup?"yes":"no"))}}!function(e,t,a){t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a}(C,"propTypes",{dataAdapter:r().object.isRequired});const S=C;class A extends o.Component{render(){return o.createElement("div",null,o.createElement("p",null,"The CSV data adapter can read key value pairs from a CSV file."),o.createElement("p",null,"Please make sure your CSV file is formatted according to your configuration settings."),o.createElement(c.bZ,{style:{marginBottom:10},bsStyle:"info"},o.createElement("h4",{style:{marginBottom:10}},"CSV file requirements:"),o.createElement("ul",{className:"no-padding"},o.createElement("li",null,"The first line in the CSV file needs to be a list of field/column names"),o.createElement("li",null,"The file uses ",o.createElement("strong",null,"utf-8")," encoding"),o.createElement("li",null,"The file is readable by ",o.createElement("strong",null,"every")," Graylog server node"))),o.createElement("hr",null),o.createElement("h3",{style:{marginBottom:10}},"Example 1"),o.createElement("h5",{style:{marginBottom:10}},"Configuration"),o.createElement("p",{style:{marginBottom:10,padding:0}},"Separator: ",o.createElement("code",null,","),o.createElement("br",null),"Quote character: ",o.createElement("code",null,'"'),o.createElement("br",null),"Key column: ",o.createElement("code",null,"ipaddr"),o.createElement("br",null),"Value column: ",o.createElement("code",null,"hostname")),o.createElement("h5",{style:{marginBottom:10}},"CSV File"),o.createElement("pre",null,'"ipaddr","hostname"\n"127.0.0.1","localhost"\n"10.0.0.1","server1"\n"10.0.0.2","server2"'),o.createElement("h3",{style:{marginBottom:10}},"Example 2"),o.createElement("h5",{style:{marginBottom:10}},"Configuration"),o.createElement("p",{style:{marginBottom:10,padding:0}},"Separator: ",o.createElement("code",null,";"),o.createElement("br",null),"Quote character: ",o.createElement("code",null,"'"),o.createElement("br",null),"Key column: ",o.createElement("code",null,"ipaddr"),o.createElement("br",null),"Value column: ",o.createElement("code",null,"hostname")),o.createElement("h5",{style:{marginBottom:10}},"CSV File"),o.createElement("pre",null,"'ipaddr';'lladdr';'hostname'\n'127.0.0.1';'e4:b2:11:d1:38:14';'localhost'\n'10.0.0.1';'e4:b2:12:d1:48:28';'server1'\n'10.0.0.2';'e4:b2:11:d1:58:34';'server2'"))}}const T=A;function k(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class P extends o.Component{constructor(){super(...arguments),k(this,"_onLookupTypeSelect",(e=>{const{config:t,updateConfig:a}=this.props,l=i.Z.clone(t);l.lookup_type=e,a(l)})),k(this,"updateCacheTTLOverride",((e,t,a)=>{this._updateCacheTTLOverride(e,t,a,"cache_ttl_override")})),k(this,"_updateCacheTTLOverride",((e,t,a,l)=>{const{config:n,updateConfig:r}=this.props,o=i.Z.clone(n);a&&e?(o[l]=a&&e?e:null,o[`${l}_enabled`]=a):(o[l]=null,o[`${l}_enabled`]=!1),o[`${l}_unit`]=a?t:null,r(o)}))}render(){const{config:e,handleFormEvent:t,validationMessage:a,validationState:l}=this.props;return o.createElement("fieldset",null,o.createElement(c.II,{label:"DNS Lookup Type",id:"lookup-type",required:!0,autoFocus:!0,help:"Select the type of DNS lookup to perform.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},o.createElement(u.Ph,{placeholder:"Select the type of DNS lookup",clearable:!1,options:[{label:"Resolve hostname to IPv4 address (A)",value:"A"},{label:"Resolve hostname to IPv6 address (AAAA)",value:"AAAA"},{label:"Resolve hostname to IPv4 and IPv6 addresses (A and AAAA)",value:"A_AAAA"},{label:"Reverse lookup (PTR)",value:"PTR"},{label:"Text lookup (TXT)",value:"TXT"}],matchProp:"label",onChange:this._onLookupTypeSelect,value:e.lookup_type})),o.createElement(c.II,{type:"text",id:"server_ips",name:"server_ips",label:"DNS Server IP Address",onChange:t,help:a("server_ips","An optional comma-separated list of DNS server IP addresses."),bsStyle:l("server_ips"),value:e.server_ips,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"number",id:"request_timeout",name:"request_timeout",label:"DNS Request Timeout",required:!0,onChange:t,help:a("request_timeout","DNS request timeout in milliseconds."),bsStyle:l("request_timeout"),value:e.request_timeout,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(u.AX,{label:"Cache TTL Override",help:"If enabled, the cache TTL will be overridden with the specified value.",update:this.updateCacheTTLOverride,value:e.cache_ttl_override,unit:e.cache_ttl_override_unit||"MINUTES",units:["MILLISECONDS","SECONDS","MINUTES","HOURS","DAYS"],enabled:e.cache_ttl_override_enabled,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}))}}k(P,"propTypes",{config:r().shape({request_timeout:r().number.isRequired,server_ips:r().string}).isRequired,updateConfig:r().func.isRequired,handleFormEvent:r().func.isRequired,validationMessage:r().func.isRequired,validationState:r().func.isRequired});const N=P,w=e=>{let{dataAdapter:t}=e;const{config:a}=t;return o.createElement("dl",null,o.createElement("dt",null,"DNS Lookup Type"),o.createElement("dd",null,{A:"Resolve hostname to IPv4 address (A)",AAAA:"Resolve hostname to IPv6 address (AAAA)",A_AAAA:"Resolve hostname to IPv4 and IPv6 address (A and AAAA)",PTR:"Reverse lookup (PTR)",TXT:"Text lookup (TXT)"}[a.lookup_type]),o.createElement("dt",null,"DNS Server IP Address"),o.createElement("dd",null,a.server_ips||"n/a"),o.createElement("dt",null,"DNS Request Timeout"),o.createElement("dd",null,a.request_timeout," ms"),o.createElement("dt",null,"Cache TTL Override"),o.createElement("dd",null,a.cache_ttl_override_enabled?o.createElement(u.j1,{value:a.cache_ttl_override,unit:a.cache_ttl_override_unit}):"n/a"))};w.propTypes={dataAdapter:r().shape({config:r().shape({lookup_type:r().string.isRequired,request_timeout:r().number.isRequired})}).isRequired};const I=w;var x=a("J6y4/h8P");const R=x.default.pre.withConfig({displayName:"DnsAdapterDocumentation__StyledPre",componentId:"sc-2vdazb-0"})((e=>{let{theme:t}=e;return(0,x.css)(["font-size:",";"],t.fonts.size.small)})),O=()=>{const e={marginBottom:10};return o.createElement("div",null,o.createElement("h3",{style:e},"Configuration"),o.createElement("h5",{style:e},"DNS Lookup Type"),o.createElement("p",{style:e},o.createElement("strong",null,"Resolve hostname to IPv4 address (A)"),": Returns both a ",o.createElement("code",null,"single_value")," containing one of the IPv4 addresses that the hostname resolves to, and a ",o.createElement("code",null,"multi_value")," containing all IPv4 addresses that the hostname resolves to. Input for this type must be a pure domain name (eg. ",o.createElement("code",null,"api.graylog.com"),")."),o.createElement(R,null,'{\n  "single_value": "34.239.63.98",\n  "multi_value": {\n    "results": [\n      {\n        "ip_address": "34.239.63.98",\n        "dns_ttl": 60\n      },\n      {\n        "ip_address": "34.238.48.57",\n        "dns_ttl": 60\n      }\n    ]\n  },\n  "ttl": 60000\n}'),o.createElement("p",{style:e},o.createElement("strong",null,"Resolve hostname to IPv6 address (AAAA)"),": Returns both a ",o.createElement("code",null,"single_value")," containing one of the IPv6 addresses that the hostname resolves to, and a ",o.createElement("code",null,"multi_value")," containing all IPv6 addresses that the hostname resolves to. Input for this type must be a pure domain name (eg. ",o.createElement("code",null,"api.graylog.com"),")."),o.createElement(R,null,'{\n  "single_value": "2307:f8b0:3000:800:0:0:0:200e",\n  "multi_value": {\n    "results": [\n      {\n        "ip_address": "2307:f8b0:3000:800:0:0:0:200e",\n        "dns_ttl": 77\n      }\n    ]\n  },\n  "ttl": 77000\n}'),o.createElement("p",{style:e},o.createElement("strong",null,"Resolve hostname to IPv4 and IPv6 address (A and AAAA)"),": Returns both a ",o.createElement("code",null,"single_value")," containing one of the IPv4 or IPv6 addresses that the hostname resolves to (will return IPv4 if available), and a ",o.createElement("code",null,"multi_value")," containing all IPv4 and IPv6 addresses that the hostname resolves to. Input for this type must be a pure domain name (eg. ",o.createElement("code",null,"api.graylog.com"),")."),o.createElement(R,null,'{\n  "single_value": "144.222.6.132",\n  "multi_value": {\n    "results": [\n      {\n        "ip_address": "144.222.6.132",\n        "dns_ttl": 32,\n        "ip_version": "IPv4"\n      },\n      {\n        "ip_address": "1207:f8b1:6003:b01:0:0:0:8a",\n        "dns_ttl": 299,\n        "ip_version": "IPv6"\n      }\n    ]\n  },\n  "ttl": 32000\n}'),o.createElement("p",{style:e},o.createElement("strong",null,"Reverse lookup (PTR)"),": Returns a ",o.createElement("code",null,"single_value")," containing the PTR value if defined for the IP address. The ",o.createElement("code",null,"domain")," field displays the domain name (with no subdomains). The ",o.createElement("code",null,"full_domain")," field displays the full un-trimmed host name/PTR value. The input for this type must be a pure IPv4 or IPv6 address (eg. ",o.createElement("code",null,"10.0.0.1")," or ",o.createElement("code",null,"2622:f3b0:4000:812::200c"),")."),o.createElement(R,null,'{\n  "single_value": "c-45-216-65-41.hd1.fl.someisp.co.uk",\n  "multi_value": {\n    "domain": "someisp.co.uk",\n    "full_domain": "c-45-216-65-41.hd1.fl.someisp.co.uk",\n    "dns_ttl": "300",\n  },\n  "ttl": 300000\n}'),o.createElement("p",{style:e},o.createElement("strong",null,"Text lookup (TXT)"),": Returns a ",o.createElement("code",null,"multi_value")," with all TXT records defined for the hostname. Input for this type must be a pure domain name (eg. ",o.createElement("code",null,"api.graylog.com"),")."),o.createElement(R,null,'{\n  "single_value": null,\n  "multi_value": {\n    "results": [\n      {\n        "value": "Some text value that lives in a TXT DNS",\n        "dns_ttl": 300\n      },\n      {\n        "value": "v=spf1 include:some-email-domain.org ~all.",\n        "dns_ttl": 200\n      }\n    ]\n  },\n  "ttl": 200000\n}'),o.createElement("h5",{style:e},"DNS Server IP Addresses"),o.createElement("p",{style:e},"A comma-separated list of DNS server IP addresses and optional ports to use (eg. ",o.createElement("code",null,"192.168.1.1:5353, 192.168.1.244"),"). Leave this blank to use the DNS server defined for your local system. All requests use port 53 unless otherwise specified."),o.createElement("h5",{style:e},"DNS Request Timeout"),o.createElement("p",{style:e},"The DNS request timeout in milliseconds."),o.createElement("h5",{style:e},"Cache TTL Override"),o.createElement("p",{style:e},"If enabled, the TTL for this adapter's cache will be overridden with the specified value."))},L=e=>{let{handleFormEvent:t,validationState:a,validationMessage:l,config:n}=e;return o.createElement("fieldset",null,o.createElement(u.zX,{label:"File URL",onChange:t,validationMessage:l("url","The URL of the DSV file."),validationState:a("url"),url:n.url,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"number",id:"refresh_interval",name:"refresh_interval",label:"Refresh interval",required:!0,onChange:t,help:"The interval to check if the DSV file needs a reload. (in seconds)",value:n.refresh_interval,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"separator",name:"separator",label:"Separator",required:!0,onChange:t,help:"The delimiter to use for separating columns of entries.",value:n.separator,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"line_separator",name:"line_separator",label:"Line Separator",required:!0,onChange:t,help:"The delimiter to use for separating lines.",value:n.line_separator,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"quotechar",name:"quotechar",label:"Quote character",required:!0,onChange:t,help:"The character to use for quoted elements.",value:n.quotechar,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"ignorechar",name:"ignorechar",label:"Ignore characters",required:!0,onChange:t,help:"Ignore lines starting with these characters.",value:n.ignorechar,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"key_column",name:"key_column",label:"Key column",required:!0,onChange:t,help:"The column number that should be used for the key lookup.",value:n.key_column,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"value_column",name:"value_column",label:"Value column",required:!0,onChange:t,help:"The column number that should be used as the value for a key.",value:n.value_column,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"checkbox",id:"case_insensitive_lookup",name:"case_insensitive_lookup",label:"Allow case-insensitive lookups",checked:n.case_insensitive_lookup,onChange:t,help:"Enable if the key lookup should be case-insensitive.",wrapperClassName:"col-md-offset-3 col-md-9"}),o.createElement(c.II,{type:"checkbox",id:"check_presence_only",name:"check_presence_only",label:"Check Presence Only",checked:n.check_presence_only,onChange:t,help:"Only check if key is present in table, returns boolean instead of value.",wrapperClassName:"col-md-offset-3 col-md-9"}))};L.propTypes={config:r().object.isRequired,handleFormEvent:r().func.isRequired,validationState:r().func.isRequired,validationMessage:r().func.isRequired};const D=L,q=e=>{let{dataAdapter:t}=e;const{config:a}=t;return o.createElement("dl",null,o.createElement("dt",null,"File URL"),o.createElement("dd",null,a.url),o.createElement("dt",null,"Separator"),o.createElement("dd",null,o.createElement("code",null,a.separator)),o.createElement("dt",null,"Line Separator"),o.createElement("dd",null,o.createElement("code",null,a.line_separator)),o.createElement("dt",null,"Quote character"),o.createElement("dd",null,o.createElement("code",null,a.quotechar)),o.createElement("dt",null,"Ignore lines starting with"),o.createElement("dd",null,o.createElement("code",null,a.ignorechar)),o.createElement("dt",null,"Key column"),o.createElement("dd",null,a.key_column),o.createElement("dt",null,"Value column"),o.createElement("dd",null,a.value_column),o.createElement("dt",null,"Check interval"),o.createElement("dd",null,a.check_interval," seconds"),o.createElement("dt",null,"Case-insensitive lookup"),o.createElement("dd",null,a.case_insensitive_lookup?"yes":"no"))},B=()=>o.createElement("div",null,o.createElement("p",null,"The DSV data adapter can read key value pairs (or check for the presence of a key) from a DSV file."),o.createElement("p",null,"Please make sure your DSV file is formatted according to your configuration settings."),o.createElement(c.bZ,{style:{marginBottom:10},bsStyle:"info"},o.createElement("h4",{style:{marginBottom:10}},"CSV file requirements:"),o.createElement("ul",{className:"no-padding"},o.createElement("li",null,"The file uses ",o.createElement("strong",null,"utf-8")," encoding"),o.createElement("li",null,"The file is accessible using the same URL by ",o.createElement("strong",null,"every")," Graylog server node"))),o.createElement("hr",null),o.createElement("h3",{style:{marginBottom:10}},"Example 1"),o.createElement("h5",{style:{marginBottom:10}},"Configuration"),o.createElement("p",{style:{marginBottom:10,padding:0}},"Separator: ",o.createElement("code",null,","),o.createElement("br",null),"Quote character: ",o.createElement("code",null,'"'),o.createElement("br",null)),o.createElement("h5",{style:{marginBottom:10}},"DSV File"),o.createElement("pre",null,'"127.0.0.1","localhost"\n"10.0.0.1","server1"\n"10.0.0.2","server2"'),o.createElement("h3",{style:{marginBottom:10}},"Example 2"),o.createElement("h5",{style:{marginBottom:10}},"Configuration"),o.createElement("p",{style:{marginBottom:10,padding:0}},"Separator: ",o.createElement("code",null,";"),o.createElement("br",null),"Quote character: ",o.createElement("code",null,"'"),o.createElement("br",null)),o.createElement("h5",{style:{marginBottom:10}},"DSV File"),o.createElement("pre",null,"'127.0.0.1';'e4:b2:11:d1:38:14'\n'10.0.0.1';'e4:b2:12:d1:48:28'\n'10.0.0.2';'e4:b2:11:d1:58:34'"));function Z(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class U extends o.Component{constructor(){super(...arguments),Z(this,"onHTTPHeaderUpdate",(e=>{const{config:t,updateConfig:a}=this.props,l=i.Z.clone(t);l.headers=e,a(l)}))}render(){const{config:e,handleFormEvent:t,validationMessage:a,validationState:l}=this.props;return o.createElement("fieldset",null,o.createElement(u.zX,{label:"Lookup URL",onChange:t,validationMessage:a("url","The URL for the lookup. (this is a template - see documentation)"),validationState:l("url"),url:e.url,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",urlType:"regex"}),o.createElement(c.II,{type:"text",id:"single_value_jsonpath",name:"single_value_jsonpath",label:"Single value JSONPath",required:!0,onChange:t,help:a("single_value_jsonpath","The JSONPath string to get the single value from the response."),bsStyle:l("single_value_jsonpath"),value:e.single_value_jsonpath,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"multi_value_jsonpath",name:"multi_value_jsonpath",label:"Multi value JSONPath",onChange:t,help:a("multi_value_jsonpath","The JSONPath string to get the multi value from the response. Needs to return a list or map. (optional)"),bsStyle:l("multi_value_jsonpath"),value:e.multi_value_jsonpath,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"user_agent",name:"user_agent",label:"HTTP User-Agent",required:!0,onChange:t,help:"The User-Agent header to use for the HTTP request.",value:e.user_agent,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{id:"http_headers",label:"HTTP Headers",help:"The custom HTTP headers to use for the HTTP request. Multiple values must be comma-separated.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},o.createElement(u.vu,{pairs:e.headers||{},editable:!0,onChange:this.onHTTPHeaderUpdate})))}}Z(U,"propTypes",{config:r().object.isRequired,updateConfig:r().func.isRequired,handleFormEvent:r().func.isRequired,validationState:r().func.isRequired,validationMessage:r().func.isRequired});const M=U,F=e=>{let{dataAdapter:t}=e;const{config:a}=t;return o.createElement("dl",null,o.createElement("dt",null,"Lookup URL"),o.createElement("dd",null,a.url),o.createElement("dt",null,"Single value JSONPath"),o.createElement("dd",null,o.createElement("code",null,a.single_value_jsonpath)),o.createElement("dt",null,"Multi value JSONPath"),o.createElement("dd",null,o.createElement("code",null,a.multi_value_jsonpath)),o.createElement("dt",null,"HTTP User-Agent"),o.createElement("dd",null,a.user_agent),o.createElement("dt",null,"HTTP Headers"),o.createElement("dd",null,o.createElement(u.vu,{pairs:a.headers||{}})))};F.propTypes={dataAdapter:r().object.isRequired};const J=F,H=()=>o.createElement("div",null,o.createElement("p",null,"The HTTPJSONPath data adapter executes ",o.createElement("em",null,"HTTP GET")," requests to lookup a key and parses the result based on configured JSONPath expressions."),o.createElement(c.bZ,{style:{marginBottom:10},bsStyle:"info"},"Every lookup table result has two values. A ",o.createElement("em",null,"single value")," and a ",o.createElement("em",null,"multi value"),". The single value will be used when the lookup result is expected to be a string, number or boolean. The multi value will be used when the lookup result is expected to be a map or list."),o.createElement("h3",{style:{marginBottom:10}},"Configuration"),o.createElement("h5",{style:{marginBottom:10}},"Lookup URL"),o.createElement("p",{style:{marginBottom:10,padding:0}},"The URL that will be used for the HTTP request. To use the ",o.createElement("em",null,"lookup key")," in the URL, the",o.createElement("code",null,"${key}"),"value can be used. This variable will be replaced by the actual key that is passed to a lookup function. ",o.createElement("br",null),"(example: ",o.createElement("code",null,"https://example.com/api/lookup?key=${key}"),")"),o.createElement("h5",{style:{marginBottom:10}},"Single value JSONPath"),o.createElement("p",{style:{marginBottom:10,padding:0}},"This JSONPath expression will be used to parse the ",o.createElement("em",null,"single value")," of the lookup result. (example: ",o.createElement("code",null,"$.user.full_name"),")"),o.createElement("h5",{style:{marginBottom:10}},"Multi value JSONPath"),o.createElement("p",{style:{marginBottom:10,padding:0}},"This JSONPath expression will be used to parse the ",o.createElement("em",null,"multi value")," of the lookup result. (example: ",o.createElement("code",null,"$.users[*]"),") The multi value JSONPath setting is ",o.createElement("em",null,"optional"),". Without it, the single value is also present in the multi value result."),o.createElement("h5",{style:{marginBottom:10}},"HTTP User-Agent"),o.createElement("p",{style:{marginBottom:10,padding:0}},"This is the ",o.createElement("em",null,"User-Agent")," header that will be used for the HTTP requests. You should include some contact details so owners of the services you query know whom to contact if issues arise. (like excessive API requests from your Graylog cluster)"),o.createElement("hr",null),o.createElement("h3",{style:{marginBottom:10}},"Example"),o.createElement("p",null,"This shows an example configuration and the values that will be returned from a lookup.",o.createElement("br",null),"The configured URL is ",o.createElement("strong",null,"https://example.com/api/users/${key}")," and the ",o.createElement("code",null,"${key}"),"gets replaced by ",o.createElement("strong",null,"jane")," during the lookup request."),o.createElement("p",null,"This is the resulting JSON document:"),o.createElement("pre",null,'{\n  "user": {\n    "login": "jane",\n    "full_name": "Jane Doe",\n    "roles": ["admin", "developer"],\n    "contact": {\n      "email": "[email protected]",\n      "cellphone": "+49123456789"\n    }\n  }\n}'),o.createElement(c.X2,null,o.createElement(c.JX,{md:4},o.createElement("h5",{style:{marginBottom:10}},"Configuration"),o.createElement("p",{style:{marginBottom:10,padding:0}},"Single value JSONPath: ",o.createElement("code",null,"$.user.full_name"),o.createElement("br",null),"Multi value JSONPath: ",o.createElement("em",null,"empty"),o.createElement("br",null))),o.createElement(c.JX,{md:8},o.createElement("h5",{style:{marginBottom:10}},"Result"),o.createElement("p",{style:{marginBottom:10,padding:0}},"Single value: ",o.createElement("code",null,"Jane Doe"),o.createElement("br",null),"Multi value:"),o.createElement("pre",null,'{"value": "Jane Doe"}'))),o.createElement(c.X2,null,o.createElement(c.JX,{md:4},o.createElement("h5",{style:{marginBottom:10}},"Configuration"),o.createElement("p",{style:{marginBottom:10,padding:0}},"Single value JSONPath: ",o.createElement("code",null,"$.user.full_name"),o.createElement("br",null),"Multi value JSONPath: ",o.createElement("code",null,"$.user"),o.createElement("br",null))),o.createElement(c.JX,{md:8},o.createElement("h5",{style:{marginBottom:10}},"Result"),o.createElement("p",{style:{marginBottom:10,padding:0}},"Single value: ",o.createElement("code",null,"Jane Doe"),o.createElement("br",null),"Multi value:"),o.createElement("pre",null,'{\n  "login": "jane",\n  "full_name": "Jane Doe",\n  "roles": ["admin", "developer"],\n  "contact": {\n    "email": "[email protected]",\n    "cellphone": "+49123456789"\n  }\n}'))),o.createElement(c.X2,null,o.createElement(c.JX,{md:4},o.createElement("h5",{style:{marginBottom:10}},"Configuration"),o.createElement("p",{style:{marginBottom:10,padding:0}},"Single value JSONPath: ",o.createElement("code",null,"$.user.contact.email"),o.createElement("br",null),"Multi value JSONPath: ",o.createElement("code",null,"$.user.roles[*]"),o.createElement("br",null))),o.createElement(c.JX,{md:8},o.createElement("h5",{style:{marginBottom:10}},"Result"),o.createElement("p",{style:{marginBottom:10,padding:0}},"Single value: ",o.createElement("code",null,"[email protected]"),o.createElement("br",null),"Multi value:"),o.createElement("pre",null,'{\n  "value": ["admin", "developer"]\n}'))),o.createElement(c.X2,null,o.createElement(c.JX,{md:4},o.createElement("h5",{style:{marginBottom:10}},"Configuration"),o.createElement("p",{style:{marginBottom:10,padding:0}},"Single value JSONPath: ",o.createElement("code",null,"$.user.full_name"),o.createElement("br",null),"Multi value JSONPath: ",o.createElement("code",null,"$.user.contact"),o.createElement("br",null))),o.createElement(c.JX,{md:8},o.createElement("h5",{style:{marginBottom:10}},"Result"),o.createElement("p",{style:{marginBottom:10,padding:0}},"Single value: ",o.createElement("code",null,"Jane Doe"),o.createElement("br",null),"Multi value:"),o.createElement("pre",null,'{\n  "email": "[email protected]",\n  "cellphone": "+49123456789"\n}'))),o.createElement("h5",{style:{marginBottom:10}},"Pipeline Rule"),o.createElement("p",null,"This is an example pipeline rule that uses the example data from our last configuration example."),o.createElement("pre",null,'rule "lookup user"\nwhen has_field("user_login")\nthen\n  // Get the user login from the message\n  let userLogin = to_string($message.user_login);\n  // Lookup the single value, in our case the full name, in the user-api lookup table\n  let userName = lookup_value("user-api", userLogin);\n  // Set the field "user_name" in the message\n  set_field("user_name", userName)\n\n  // Lookup the multi value in the user-api lookup table\n  let userData = lookup("user-api", userLogin);\n  // Set the email and cellphone as fields in the message\n  set_field("user_email", userData["email"]);\n  set_field("user_cellphone", userData["cellphone"]);\nend'));l.PluginStore.register(new l.PluginManifest({},{lookupTableAdapters:[{type:"csvfile",displayName:"CSV File",formComponent:_,summaryComponent:S,documentationComponent:T},{type:"dnslookup",displayName:"DNS Lookup",formComponent:N,summaryComponent:I,documentationComponent:O},{type:"dsvhttp",displayName:"DSV File from HTTP",formComponent:D,summaryComponent:q,documentationComponent:B},{type:"httpjsonpath",displayName:"HTTP JSONPath",formComponent:M,summaryComponent:J,documentationComponent:H}]}));const j=()=>null,X=o.forwardRef(j),z=()=>o.createElement("p",null,"This cache has no configuration.");var Y=a("UiXZqrDE");const V=(e,t)=>{var a;let{config:l}=e;const{values:n,setValues:r,errors:s}=(0,Y.useFormikContext)(),[i,c]=o.useState({...l});o.useEffect((()=>c({...l})),[l]);o.useImperativeHandle(t,(()=>({validate:()=>(()=>{const e={};return n.config.max_size||(e.max_size="Required"),n.config.max_size<0&&(e.max_size="Must be 0 or a positive number"),e})()})));const m=e=>(t,a,l)=>{const o={...i},s={...n.config};o[e]=l?t:0,o[`${e}_unit`]=a,s[e]=l?t:0,s[`${e}_unit`]=a,c(o),r({...n,config:s})};return o.createElement("fieldset",{ref:t},o.createElement(u.Fe,{type:"text",name:"config.max_size",label:"* Maximum entries",required:!0,help:null!==(a=s.config)&&void 0!==a&&a.max_size?null:"The limit of the number of entries the cache keeps in memory.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(u.AX,{label:"Expire after access",help:"If enabled, entries are removed from the cache after the specified time from when they were last used.",update:m("expire_after_access"),name:"config.expire_after_access",unitName:"config.expire_after_access_unit",value:i.expire_after_access,unit:i.expire_after_access_unit||"SECONDS",defaultEnabled:l.expire_after_access>0,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(u.AX,{label:"Expire after write",help:"If enabled, entries are removed from the cache after the specified time from when they were first used.",update:m("expire_after_write"),name:"config.expire_after_write",unitName:"config.expire_after_write_unit",value:i.expire_after_write,unit:i.expire_after_write_unit||"SECONDS",defaultEnabled:l.expire_after_write>0,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}))},W=o.forwardRef(V),K=x.default.div.withConfig({displayName:"SummaryComponentsstyled__SummaryContainer",componentId:"sc-1glxt8e-0"})(["display:inline-block;margin:16px 0;"]),G=x.default.div.withConfig({displayName:"SummaryComponentsstyled__SummaryRow",componentId:"sc-1glxt8e-1"})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;"]),Q=x.default.span.withConfig({displayName:"SummaryComponentsstyled__Title",componentId:"sc-1glxt8e-2"})(["font-weight:bold;min-width:180px;"]),ee=x.default.span.withConfig({displayName:"SummaryComponentsstyled__Value",componentId:"sc-1glxt8e-3"})(["padding:6px 10px;width:100%;min-width:130px;"]),te=e=>{let{cache:t}=e;return o.createElement(K,null,o.createElement(G,null,o.createElement(Q,null,"Maximum entries:"),o.createElement(ee,{style:{borderBottom:"1px solid #eee"}},t.config.max_size)),o.createElement(G,null,o.createElement(Q,null,"Expire after access:"),o.createElement(ee,{style:{borderBottom:"1px solid #eee"}},o.createElement(u.j1,{value:t.config.expire_after_access,unit:t.config.expire_after_access_unit}))),o.createElement(G,null,o.createElement(Q,null,"Expire after write:"),o.createElement(ee,null,o.createElement(u.j1,{value:t.config.expire_after_write,unit:t.config.expire_after_write_unit}))))},ae=()=>o.createElement("div",null,o.createElement("p",null,"The in-memory cache maintains recently used values from data adapters."),o.createElement("p",null,"Please make sure your Graylog servers have enough heap to accomodate the cached entries and monitor the cache efficiency."),o.createElement(c.bZ,{style:{marginBottom:10},bsStyle:"info"},o.createElement("h4",{style:{marginBottom:10}},"Implementation details"),o.createElement("p",null,"The cache is local to each Graylog server, they do not share the entries."),o.createElement("p",null,"For example, if you have two servers, they will maintain a completely independent cache from each other.")),o.createElement("hr",null),o.createElement("h3",{style:{marginBottom:10}},"Cache size"),o.createElement("p",null,"Every cache has a maximum number of entries, unbounded caches are not supported."),o.createElement("h3",{style:{marginBottom:10}},"Time-based expiration"),o.createElement("h5",{style:{marginBottom:10}},"Expire after access"),o.createElement("p",{style:{marginBottom:10,padding:0}},"The cache will remove entries after a fixed time since they have been used the last time.",o.createElement("br",null),"This results in the cache behaving as a space limited least recently used cache."),o.createElement("h5",{style:{marginBottom:10}},"Expire after write"),o.createElement("p",{style:{marginBottom:10,padding:0}},"The cache will remove entries after a fixed time since they have been entered into the cache.",o.createElement("br",null),"This results in entries that are never older than the given time, which can be important for regularly changing data, such as configuration state of external systems."));l.PluginStore.register(new l.PluginManifest({},{lookupTableCaches:[{type:"none",displayName:"Do not cache values",formComponent:X,summaryComponent:z,documentationComponent:null},{type:"guava_cache",displayName:"Node-local, in-memory cache",formComponent:W,summaryComponent:te,documentationComponent:ae}]}));var le=a("2BBGznGN"),ne=a("EeAwn/0x"),re=a("DeVaSktS"),oe=a("Lzn6DvfV"),se=a("ECqdgSQ+");const ie=(0,x.default)(c.Si).withConfig({displayName:"LUTTableEntry__Actions",componentId:"sc-u98rsd-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;"]),ce=e=>{let{table:t,cache:a,dataAdapter:l,errors:n}=e;const r=(0,le.useHistory)(),{loadingScopePermissions:s,scopePermissions:i}=(0,se.Z)(t);return o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,n.table&&o.createElement(Ut,{placement:"right",errorText:n.table,title:"Lookup Table problem"}),o.createElement(ne.r,{to:re.ZP.SYSTEM.LOOKUPTABLES.show(t.name)},t.title)),o.createElement("td",null,t.description),o.createElement("td",null,t.name),o.createElement("td",null,n.cache&&o.createElement(Ut,{placement:"bottom",errorText:n.cache,title:"Cache problem"}),o.createElement(ne.r,{to:re.ZP.SYSTEM.LOOKUPTABLES.CACHES.show(a.name)},a.title)),o.createElement("td",null,n.dataAdapter&&o.createElement(Ut,{placement:"bottom",errorText:n.dataAdapter,title:"Data adapter problem"}),o.createElement(ne.r,{to:re.ZP.SYSTEM.LOOKUPTABLES.DATA_ADAPTERS.show(l.name)},l.title)),o.createElement("td",null,s?o.createElement(u.$j,null):i.is_mutable&&o.createElement(ie,null,o.createElement(c.zx,{bsSize:"xsmall",onClick:(m=t.name,()=>{r.push(re.ZP.SYSTEM.LOOKUPTABLES.edit(m))}),role:"button",name:"edit"},"Edit"),o.createElement(c.zx,{bsSize:"xsmall",bsStyle:"danger",onClick:()=>{window.confirm(`Are you sure you want to delete lookup table "${t.title}"?`)&&oe.H.delete(t.id).then((()=>oe.H.reloadPage()))},role:"button",name:"delete"},"Delete")))));var m};ce.defaultProps={errors:{table:null,cache:null,dataAdapter:null}};const ue=ce;var me=a("ZfRiC/i0"),de=a("dFpwyWHg"),pe=a.n(de),he=a("C2ikvoS0"),ge=a.n(he),Ee=a("1IntWRSu"),ve=a.n(Ee),be=a("8nGWeFnd"),fe=a.n(be),ye=a("TeAcaicX"),_e=a.n(ye),Ce=a("eE3+5goe"),Se=a.n(Ce),Ae=a("AJXifzOX"),Te={};Te.styleTagTransform=Se(),Te.setAttributes=fe(),Te.insert=ve().bind(null,"head"),Te.domAPI=ge(),Te.insertStyleElement=_e();pe()(Ae.Z,Te);const ke=Ae.Z&&Ae.Z.locals?Ae.Z.locals:void 0;function Pe(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const Ne=x.default.div.withConfig({displayName:"LookupTablesOverview__ScrollContainer",componentId:"sc-14l9453-0"})(["overflow-x:auto;"]),we=(e,t)=>{const a={title:"None"};return t&&t[e]||a};class Ie extends o.Component{constructor(){super(...arguments),Pe(this,"_onPageChange",((e,t)=>{oe.H.searchPaginated(e,t,this.props.pagination.query)})),Pe(this,"_onSearch",((e,t)=>{const{pageSize:a}=this.props.paginationQueryParameter;oe.H.searchPaginated(1,a,e).then(t)})),Pe(this,"_onReset",(()=>{const{resetPage:e,pageSize:t}=this.props.paginationQueryParameter;e(),oe.H.searchPaginated(1,t)})),Pe(this,"_lookupAdapterError",(e=>{if(this.props.errorStates.dataAdapters&&this.props.dataAdapters){const t=this.props.dataAdapters[e.data_adapter_id];return t?this.props.errorStates.dataAdapters[t.name]:null}return null}))}render(){const e=this.props.tables.map((e=>{const t=we(e.cache_id,this.props.caches),a=we(e.data_adapter_id,this.props.dataAdapters),l={table:this.props.errorStates.tables[e.name],cache:null,dataAdapter:this._lookupAdapterError(e)};return o.createElement(ue,{key:e.id,table:e,cache:t,dataAdapter:a,errors:l})}));return o.createElement("div",null,o.createElement(c.X2,{className:"content"},o.createElement(c.JX,{md:12},o.createElement("h2",null,"Configured lookup tables",o.createElement("span",null," ",o.createElement("small",null,this.props.pagination.total," total"))),o.createElement(u.l9,{onChange:this._onPageChange,totalItems:this.props.pagination.total},o.createElement(u.UI,{onSearch:this._onSearch,onReset:this._onReset,useLoadingState:!0},o.createElement(u.Ox,{trigger:"click",rootClose:!0,placement:"right",overlay:o.createElement(c.J2,{id:"search-query-help",className:ke.popoverWide,title:"Search Syntax Help"},o.createElement("p",null,o.createElement("strong",null,"Available search fields")),o.createElement(c.iA,{condensed:!0},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"Field"),o.createElement("th",null,"Description"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"id"),o.createElement("td",null,"Lookup Table ID")),o.createElement("tr",null,o.createElement("td",null,"title"),o.createElement("td",null,"The title of the lookup table")),o.createElement("tr",null,o.createElement("td",null,"name"),o.createElement("td",null,"The reference name of the lookup table")),o.createElement("tr",null,o.createElement("td",null,"description"),o.createElement("td",null,"The description of lookup table")))),o.createElement("p",null,o.createElement("strong",null,"Examples")),o.createElement("p",null,"Find lookup tables by parts of their names:",o.createElement("br",null),o.createElement("kbd",null,"name:geoip"),o.createElement("br",null),o.createElement("kbd",null,"name:geo")),o.createElement("p",null,"Searching without a field name matches against the ",o.createElement("code",null,"title")," field:",o.createElement("br",null),o.createElement("kbd",null,"geoip")," ",o.createElement("br",null),"is the same as",o.createElement("br",null),o.createElement("kbd",null,"title:geoip")))},o.createElement(c.zx,{bsStyle:"link",className:ke.searchHelpButton},o.createElement(u.JO,{name:"question-circle",fixedWidth:!0})))),o.createElement(Ne,null,o.createElement(c.iA,{condensed:!0,hover:!0,className:ke.overviewTable},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",{className:ke.rowTitle},"Title"),o.createElement("th",{className:ke.rowDescription},"Description"),o.createElement("th",{className:ke.rowName},"Name"),o.createElement("th",{className:ke.rowCache},"Cache"),o.createElement("th",{className:ke.rowAdapter},"Data Adapter"),o.createElement("th",{className:ke.rowActions},"Actions"))),e))))))}}Pe(Ie,"propTypes",{tables:r().arrayOf(r().object).isRequired,caches:r().objectOf(r().object).isRequired,dataAdapters:r().objectOf(r().object).isRequired,pagination:r().object.isRequired,errorStates:r().object.isRequired,paginationQueryParameter:r().object.isRequired});const xe=(0,me.Z)(Ie),Re={value:"",valid:!1},Oe=e=>{let{table:t,cache:a,dataAdapter:l}=e;const n=(0,le.useHistory)(),{loadingScopePermissions:r,scopePermissions:s}=(0,se.Z)(t),[i,u]=o.useState(Re),[m,d]=o.useState(Re),[p,h]=o.useState(null),g=e=>{const t="purgekey"===e.target.name?{...i}:{...m};switch(t.valid=e.target.value&&e.target.value.replace(/\s/g,"").length>0,t.value=e.target.value.toLowerCase(),e.target.name){case"purgekey":u(t);break;case"lookupkey":d(t),h(null)}};return o.createElement(c.X2,{className:"content"},o.createElement(c.JX,{md:6},o.createElement("h2",null,t.title),o.createElement("p",null,t.description),o.createElement("dl",null,o.createElement("dt",null,"Data adapter"),o.createElement("dd",null,o.createElement(ne.r,{to:re.ZP.SYSTEM.LOOKUPTABLES.DATA_ADAPTERS.show(l.name)},l.title)),o.createElement("dt",null,"Cache"),o.createElement("dd",null,o.createElement(ne.r,{to:re.ZP.SYSTEM.LOOKUPTABLES.CACHES.show(a.name)},a.title))),!r&&(null==s?void 0:s.is_mutable)&&o.createElement(c.zx,{bsStyle:"success",onClick:(E=t.name,()=>{n.push(re.ZP.SYSTEM.LOOKUPTABLES.edit(E))}),role:"button",name:"edit"},"Edit"),(t.default_single_value||t.default_multi_value)&&o.createElement("dl",null,o.createElement("dt",null,"Default single value"),o.createElement("dd",null,o.createElement("code",null,t.default_single_value)," ","(",t.default_single_value_type.toLowerCase(),")"),o.createElement("dt",null,"Default multi value"),o.createElement("dd",null,o.createElement("code",null,t.default_multi_value)," ","(",t.default_multi_value_type.toLowerCase(),")")),o.createElement("hr",null),o.createElement("h2",null,"Purge Cache"),o.createElement("p",null,"You can purge the complete cache for this lookup table or only the cache entry for a single key."),o.createElement("form",{onSubmit:e=>{e.preventDefault(),i.valid&&oe.H.purgeKey(t,i.value).then((()=>{u(Re)}))}},o.createElement("fieldset",null,o.createElement(c.II,{type:"text",id:"purge-key",name:"purgekey",label:"Key",onChange:g,help:"Key to purge from cache",required:!0,value:i.value}),o.createElement(c.Si,null,o.createElement(c.zx,{type:"submit",bsStyle:"success",disabled:!i.valid},"Purge key"),o.createElement(c.zx,{type:"button",bsStyle:"info",onClick:e=>{e.preventDefault(),oe.H.purgeAll(t)}},"Purge all"))))),o.createElement(c.JX,{md:6},o.createElement("h2",null,"Test lookup"),o.createElement("p",null,"You can manually query the lookup table using this form. The data will be cached as configured by Graylog."),o.createElement("form",{onSubmit:e=>{e.preventDefault(),m.valid&&oe.H.lookup(t.name,m.value).then((e=>{h(JSON.stringify(e,null,2)),d(Re)}))}},o.createElement("fieldset",null,o.createElement(c.II,{type:"text",id:"key",name:"lookupkey",label:"Key",required:!0,onChange:g,help:"Key to look up a value for.",value:m.value}),o.createElement(c.zx,{type:"submit",name:"lookupbutton",bsStyle:"success",disabled:!m.valid},"Look up"))),p&&o.createElement("div",{style:{marginTop:"16px"}},o.createElement("h4",null,"Lookup result"),o.createElement("pre",null,p))));var E};var Le=a("RjO1iR6D"),De=a.n(Le),qe=a("BSHS2nUH");const Be={id:void 0,title:"",description:"",name:"",cache_id:void 0,data_adapter_id:void 0,enable_single_value:!1,default_single_value:"",default_single_value_type:"NULL",enable_multi_value:!1,default_multi_value:"",default_multi_value_type:"NULL",content_pack:null},Ze=e=>{let{saved:t,create:a,table:l}=e;const{loadingScopePermissions:n,scopePermissions:r}=(0,se.Z)(l),s={...Be,...l,enable_single_value:""!==l.default_single_value,enable_multi_value:""!==l.default_multi_value},i=()=>qe.Z.push(re.ZP.SYSTEM.LOOKUPTABLES.OVERVIEW),m=!a&&!n&&(null==r?void 0:r.is_mutable);return o.createElement(Y.Formik,{initialValues:s,validate:e=>{const t={};return["title","name","cache_id","data_adapter_id","cache_id","default_single_value","default_multi_value"].forEach((a=>{if(!e[a]){if("default_single_value"===a&&!e.enable_single_value)return;if("default_multi_value"===a&&!e.enable_multi_value)return;t[a]="Required"}})),t},enableReinitialize:!0,onSubmit:async(e,l)=>{const n=await l.validateForm();return 0===Object.keys(n).length?(e=>{let l;const n=De()(e,["enable_single_value","enable_multi_value"]);return l=a?oe.H.create(n):oe.H.update(n),l.then((()=>t()))})(e):Promise.resolve()}},(e=>{let{values:t,errors:l,touched:n,setFieldValue:r,setFieldTouched:s,setValues:d,isSubmitting:p}=e;return o.createElement(Y.Form,{className:"form form-horizontal"},o.createElement("fieldset",null,o.createElement(u.Fe,{type:"text",name:"title",label:"Title",help:n.title&&l.title?void 0:"A short title for this lookup table.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(u.Fe,{type:"text",name:"description",label:"Description",help:"Description of the lookup table.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(u.Fe,{type:"text",name:"name",label:"Name",help:n.name&&l.name?void 0:"The name that is being used to refer to this lookup table. Must be unique.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{id:"enable_single_value",name:"enable_single_value",type:"checkbox",label:"Enable single default value",help:"Enable if the lookup table should provide a default for the single value.",wrapperClassName:"col-md-offset-3 col-md-9",checked:t.enable_single_value,onChange:()=>{r("enable_single_value",!t.enable_single_value),t.enable_single_value&&(r("default_single_value",""),r("default_single_value_type","NULL"))}}),t.enable_single_value&&o.createElement(u.Ii,{label:"Default single value",help:n.default_single_value&&l.default_single_value||"The single value that is being used as lookup result if the data adapter or cache does not find a value.",validationState:n.default_single_value&&l.default_single_value?"error":void 0,onBlur:()=>s("default_single_value",!0),update:(e,a)=>{d({...t,default_single_value:e,default_single_value_type:a})},value:t.default_single_value,valueType:t.default_single_value_type||"NULL",allowedTypes:["STRING","NUMBER","BOOLEAN","NULL"],labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{id:"enable_multi_value",name:"enable_multi_value",type:"checkbox",label:"Enable multi default value",help:"Enable if the lookup table should provide a default for the multi value.",wrapperClassName:"col-md-offset-3 col-md-9",checked:t.enable_multi_value,onChange:()=>{r("enable_multi_value",!t.enable_multi_value),t.enable_multi_value&&(r("default_multi_value",""),r("default_multi_value_type","NULL"))}}),t.enable_multi_value&&o.createElement(u.Ii,{label:"Default multi value",help:n.default_multi_value&&l.default_multi_value||"The multi value that is being used as lookup result if the data adapter or cache does not find a value.",validationState:n.default_multi_value&&l.default_multi_value?"error":void 0,onBlur:()=>s("default_multi_value",!0),update:(e,a)=>{d({...t,default_multi_value:e,default_multi_value_type:a})},value:t.default_multi_value,valueType:t.default_multi_value_type||"NULL",allowedTypes:["OBJECT","NULL"],labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"})),o.createElement(Dt,null,o.createElement(Lt,null)),o.createElement(Et,null,o.createElement(mt,null)),o.createElement("fieldset",null,o.createElement(c.X2,null,o.createElement(c.JX,{mdOffset:3,md:9},a&&o.createElement(u.Ow,{submitButtonText:"Create lookup table",submitLoadingText:"Creating lookup table...",isSubmitting:p,isAsyncSubmit:!0,onCancel:i}),m&&o.createElement(u.Ow,{submitButtonText:"Update lookup table",submitLoadingText:"Updating lookup table...",isSubmitting:p,isAsyncSubmit:!0,onCancel:i})))))}))};Ze.propTypes={saved:r().func.isRequired,create:r().bool,table:r().object},Ze.defaultProps={create:!0,table:Be};const Ue=Ze;function Me(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Fe extends o.Component{constructor(){super(...arguments),Me(this,"state",{table:void 0})}render(){return o.createElement("div",null,o.createElement(c.X2,{className:"content"},o.createElement(c.JX,{lg:8},o.createElement(Ue,{saved:this.props.saved,create:!0,validate:this.props.validate,validationErrors:this.props.validationErrors}))))}}Me(Fe,"propTypes",{saved:r().func.isRequired,validate:r().func,validationErrors:r().object}),Me(Fe,"defaultProps",{validate:null,validationErrors:{}});const $e=Fe;var Je=a("Y1Txt3Ie"),He=a("ApyIyvbD"),je=a("JRlAvJim"),Xe=a("0zEavvpT");const ze=(0,x.default)(Xe.Z).withConfig({displayName:"CacheTableEntry__Actions",componentId:"sc-1uhs59w-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;"]),Ye=e=>{let{cache:t}=e;const a=(0,le.useHistory)(),{loadingScopePermissions:l,scopePermissions:n}=(0,se.Z)(t),r={requests:`org.graylog2.lookup.caches.${t.id}.requests`,hits:`org.graylog2.lookup.caches.${t.id}.hits`,misses:`org.graylog2.lookup.caches.${t.id}.misses`},s={count:`org.graylog2.lookup.caches.${t.id}.entries`};return o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,o.createElement(ne.r,{to:re.ZP.SYSTEM.LOOKUPTABLES.CACHES.show(t.name)},t.title)),o.createElement("td",null,t.description),o.createElement("td",null,t.name),o.createElement("td",null,o.createElement(Je.Jt,{map:s,computeValue:e=>{const t=Object.keys(e).reduce(((t,a)=>t+(Number.isNaN(e[a].count.metric.value)?0:e[a].count.metric.value)),0);return t<0?"N/A":He.Z.formatNumber(t)}})),o.createElement("td",null,o.createElement(Je.Jt,{map:r,computeValue:e=>{const t=Object.keys(e).reduce(((t,a)=>t+(Number.isNaN(e[a].hits.metric.rate.total)?0:e[a].hits.metric.rate.total)),0),a=t+Object.keys(e).reduce(((t,a)=>t+(Number.isNaN(e[a].misses.metric.rate.total)?0:e[a].misses.metric.rate.total)),0);if(a<1)return"N/A";const l=100*t/a;return`${He.Z.formatNumber(l)}%`}})),o.createElement("td",null,o.createElement(Je.CL,{name:`org.graylog2.lookup.caches.${t.id}.requests`},o.createElement(Je.qb,{suffix:"lookups/s"}))),o.createElement("td",null,l?o.createElement(u.$j,null):n.is_mutable&&o.createElement(ze,null,o.createElement(c.zx,{bsSize:"xsmall",onClick:(i=t.name,()=>{a.push(re.ZP.SYSTEM.LOOKUPTABLES.CACHES.edit(i))}),role:"button",name:"edit"},"Edit"),o.createElement(c.zx,{bsSize:"xsmall",bsStyle:"danger",onClick:()=>{window.confirm(`Are you sure you want to delete cache "${t.title}"?`)&&je.Z.delete(t.id).then((()=>je.Z.reloadPage()))},role:"button",name:"delete"},"Delete")))));var i};function Ve(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const We=x.default.div.withConfig({displayName:"CachesOverview__ScrollContainer",componentId:"sc-18lunb7-0"})(["overflow-x:auto;"]);class Ke extends o.Component{constructor(){super(...arguments),Ve(this,"_onPageChange",((e,t)=>{const{pagination:a}=this.props;je.Z.searchPaginated(e,t,a.query)})),Ve(this,"_onSearch",((e,t)=>{const{pageSize:a}=this.props.paginationQueryParameter;je.Z.searchPaginated(1,a,e).then(t)})),Ve(this,"_onReset",(()=>{const{resetPage:e,pageSize:t}=this.props.paginationQueryParameter;e(),je.Z.searchPaginated(1,t)}))}render(){const{caches:e,pagination:t}=this.props;if(!e)return o.createElement(u.$j,{text:"Loading caches"});const a=e.map((e=>o.createElement(Ye,{key:e.id,cache:e})));return o.createElement("div",null,o.createElement(c.X2,{className:"content"},o.createElement(c.JX,{md:12},o.createElement("h2",null,"Configured lookup Caches",o.createElement("span",null," ",o.createElement("small",null,t.total," total"))),o.createElement(u.l9,{onChange:this._onPageChange,totalItems:t.total},o.createElement(u.UI,{onSearch:this._onSearch,onReset:this._onReset,useLoadingState:!0},o.createElement(u.Ox,{trigger:"click",rootClose:!0,placement:"right",overlay:o.createElement(c.J2,{id:"search-query-help",className:ke.popoverWide,title:"Search Syntax Help"},o.createElement("p",null,o.createElement("strong",null,"Available search fields")),o.createElement(c.iA,{condensed:!0},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"Field"),o.createElement("th",null,"Description"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"id"),o.createElement("td",null,"Cache ID")),o.createElement("tr",null,o.createElement("td",null,"title"),o.createElement("td",null,"The title of the cache")),o.createElement("tr",null,o.createElement("td",null,"name"),o.createElement("td",null,"The reference name of the cache")),o.createElement("tr",null,o.createElement("td",null,"description"),o.createElement("td",null,"The description of cache")))),o.createElement("p",null,o.createElement("strong",null,"Examples")),o.createElement("p",null,"Find caches by parts of their names:",o.createElement("br",null),o.createElement("kbd",null,"name:guava"),o.createElement("br",null),o.createElement("kbd",null,"name:gua")),o.createElement("p",null,"Searching without a field name matches against the ",o.createElement("code",null,"title")," field:",o.createElement("br",null),o.createElement("kbd",null,"guava")," ",o.createElement("br",null),"is the same as",o.createElement("br",null),o.createElement("kbd",null,"title:guava")))},o.createElement(c.zx,{bsStyle:"link",className:ke.searchHelpButton},o.createElement(u.JO,{name:"question-circle",fixedWidth:!0})))),o.createElement(We,null,o.createElement(c.iA,{condensed:!0,hover:!0,className:ke.overviewTable},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",{className:ke.rowTitle},"Title"),o.createElement("th",{className:ke.rowDescription},"Description"),o.createElement("th",{className:ke.rowName},"Name"),o.createElement("th",null,"Entries"),o.createElement("th",null,"Hit rate"),o.createElement("th",null,"Throughput"),o.createElement("th",{className:ke.rowActions},"Actions"))),a))))))}}Ve(Ke,"propTypes",{caches:r().array.isRequired,pagination:r().object.isRequired,paginationQueryParameter:r().object.isRequired});const Ge=(0,me.Z)(Ke);var Qe=a("RwbKyha4");const et=e=>{let{cache:t}=e;const a=(0,le.useHistory)(),{loadingScopePermissions:l,scopePermissions:n}=(0,se.Z)(t),r=(0,Qe.Z)("lookupTableCaches").find((e=>{var a;return e.type===(null===(a=t.config)||void 0===a?void 0:a.type)}));if(!r)return o.createElement("p",null,"Unknown cache type ",t.config.type,". Is the plugin missing?");return o.createElement(c.X2,{className:"content"},o.createElement(c.JX,{md:12},o.createElement("h2",null,t.title," ",o.createElement("small",null,"(",r.displayName,")")),o.createElement(K,null,o.createElement(G,null,o.createElement(Q,null,"Description:"),o.createElement(ee,null,t.description||o.createElement("em",null,"No description.")))),o.createElement("h4",null,"Configuration"),o.createElement("div",null,o.createElement(r.summaryComponent,{cache:t})),!l&&(null==n?void 0:n.is_mutable)&&o.createElement(c.zx,{bsStyle:"success",onClick:(s=t.name,()=>{a.push(re.ZP.SYSTEM.LOOKUPTABLES.CACHES.edit(s))}),role:"button",name:"edit"},"Edit")));var s};var tt=a("nHcjWeCO"),at=a.n(tt);const lt=e=>{let{title:t,typeName:a,create:l}=e;const n=l?"h3":"h2";return o.createElement(n,{style:{marginBottom:"12px"}},t," ",o.createElement("small",null,"(",a,")"))},nt={id:void 0,title:"",description:"",name:"",config:{}},rt=e=>{let{type:t,saved:a,title:n,create:r,cache:s,validate:i,validationErrors:m}=e;const d=o.useRef(null),[p,h]=o.useState(r),{loadingScopePermissions:g,scopePermissions:E}=(0,se.Z)(s),v=o.useMemo((()=>l.PluginStore.exports("lookupTableCaches").find((e=>e.type===t))),[t]),b=o.useMemo((()=>v.displayName||t),[v,t]),f=o.useMemo((()=>v.documentationComponent),[v]),y=o.useMemo((()=>v?o.createElement(v.formComponent,{config:s.config,ref:d}):null),[v,s.config]),_=(e,t)=>a=>{if(!p)return;const l=a.target.value.trim().replace(/\W+/g,"-").toLocaleLowerCase();t({...e,title:a.target.value,name:l})},C=()=>qe.Z.push(re.ZP.SYSTEM.LOOKUPTABLES.CACHES.OVERVIEW),S=!r&&!g&&(null==E?void 0:E.is_mutable);return o.createElement(o.Fragment,null,o.createElement(lt,{title:n,typeName:b,create:r}),o.createElement(c.X2,null,o.createElement(c.JX,{lg:6,style:{marginTop:10}},o.createElement(Y.Formik,{initialValues:{...nt,...s},validate:e=>{const t={};if(e.title||(t.title="Required"),e.name?i(e):t.name="Required","none"!==e.config.type){var a;const e=(null===(a=d.current)||void 0===a?void 0:a.validate())||{};at().isEmpty(e)||(t.config=e)}return t},validateOnBlur:!0,validateOnChange:!1,validateOnMount:!r,onSubmit:e=>(r?je.Z.create(e):je.Z.update(e)).then((()=>a())),enableReinitialize:!0},(e=>{let{errors:t,values:a,setValues:l,isSubmitting:n}=e;return o.createElement(Y.Form,{className:"form form-horizontal"},o.createElement("fieldset",null,o.createElement(u.Fe,{type:"text",name:"title",label:"* Title",required:!0,help:t.title?null:"A short title for this cache.",onChange:_(a,l),autoFocus:!0,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(u.Fe,{type:"text",name:"description",label:"Description",help:"Cache description.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(u.Fe,{type:"text",name:"name",label:"* Name",required:!0,error:m.name?m.name[0]:null,onChange:()=>h(!1),help:t.name||m.name?null:"The name that is being used to refer to this cache. Must be unique.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"})),y,o.createElement("fieldset",null,o.createElement(c.X2,null,o.createElement(c.JX,{mdOffset:3,sm:12},r&&o.createElement(u.Ow,{submitButtonText:"Create cache",submitLoadingText:"Creating cache...",isSubmitting:n,isAsyncSubmit:!0,onCancel:C}),S&&o.createElement(u.Ow,{submitButtonText:"Update cache",submitLoadingText:"Updating cache...",isAsyncSubmit:!0,isSubmitting:n,onCancel:C})))))}))),o.createElement(c.JX,{lg:6,style:{marginTop:10}},f?o.createElement(f,null):null)))};rt.defaultProps={create:!0,cache:nt,validate:null,validationErrors:{}};const ot=rt;var st=a("6n4dw8v3");const it={id:null,title:"",name:"",description:"",config:{type:"none"}},ct=e=>{let{saved:t,types:a,validate:l,validationErrors:n}=e;const[r,s]=o.useState(null),i=(0,Qe.Z)("lookupTableCaches"),m=o.useMemo((()=>i.reduce(((e,t)=>(e[t.type]=t,e)),{})),[i]),d=o.useMemo((()=>Object.values(a).map((e=>({value:e.type,label:m[e.type].displayName}))).sort(((e,t)=>(0,st.S)(e.label.toLowerCase(),t.label.toLowerCase())))),[a,m]),p=o.useMemo((()=>{var e;return r?{...it,config:{...null===(e=a[r])||void 0===e?void 0:e.default_config}}:null}),[r,a]);return o.createElement(o.Fragment,null,o.createElement(c.X2,{className:"content"},o.createElement(c.JX,{lg:6,className:"form form-horizontal"},o.createElement(c.II,{id:"cache-type-select",label:"Cache Type",required:!0,autoFocus:!0,help:"The type of cache to configure.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},o.createElement(u.Ph,{placeholder:"Select Cache Type",clearable:!1,options:d,matchProp:"label",onChange:e=>{s(e)},value:r})))),p&&o.createElement(c.X2,{className:"content"},o.createElement(c.JX,{lg:12},o.createElement(ot,{cache:p,type:r,title:"Configure Cache",create:!0,saved:t,validationErrors:n,validate:l}))))},ut=e=>{let{caches:t}=e;const[,{value:a,touched:l,error:n},{setTouched:r,setValue:s}]=(0,Y.useField)("cache_id"),i=t.map((e=>({value:e.id,label:`${e.title} (${e.name})`}))).sort(((e,t)=>(0,st.S)(e.label.toLowerCase(),t.label.toLowerCase()))),m=l?n:"";return o.createElement("fieldset",null,o.createElement(c.II,{id:"cache-select",label:"Cache",required:!0,autoFocus:!0,bsStyle:m?"error":void 0,help:m||"Select an existing cache",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},o.createElement(u.Ph,{placeholder:"Select a cache",clearable:!1,options:i,matchProp:"label",onBlur:()=>r(!0),onChange:s,value:a})))};ut.propTypes={caches:r().array},ut.defaultProps={caches:[]};const mt=ut;var dt=a("D4SbLiE/"),pt=a.n(dt),ht=a("JnTtTRmZ"),gt=a.n(ht);const Et=pt()({displayName:"CachesContainer",propTypes:{children:r().oneOfType([r().arrayOf(r().node),r().node])},mixins:[gt().connect(je.$)],getDefaultProps:()=>({children:null}),componentDidMount(){je.Z.searchPaginated(1,1e4,null)},render(){if(!this.state.caches)return o.createElement(u.$j,null);const e=o.Children.map(this.props.children,(e=>o.cloneElement(e,{caches:this.state.caches,pagination:this.state.pagination})));return o.createElement("div",null,e)}});var vt=a("fc2k63r4");const bt=(0,x.default)(c.Si).withConfig({displayName:"DataAdapterTableEntry__Actions",componentId:"sc-1m7e9kb-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;"]),ft=e=>{let{adapter:t,error:a=null}=e;const l=(0,le.useHistory)(),{loadingScopePermissions:n,scopePermissions:r}=(0,se.Z)(t),{name:s,title:i,description:m,id:d}=t;return o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,a&&o.createElement(Ut,{errorText:a,title:"Lookup table problem",placement:"right"}),o.createElement(ne.r,{to:re.ZP.SYSTEM.LOOKUPTABLES.DATA_ADAPTERS.show(s)},i)),o.createElement("td",null,m),o.createElement("td",null,s),o.createElement("td",null,o.createElement(Je.CL,{name:`org.graylog2.lookup.adapters.${d}.requests`},o.createElement(Je.qb,{suffix:"lookups/s"}))),o.createElement("td",null,n?o.createElement(u.$j,null):r.is_mutable&&o.createElement(bt,null,o.createElement(c.zx,{bsSize:"xsmall",onClick:()=>{l.push(re.ZP.SYSTEM.LOOKUPTABLES.DATA_ADAPTERS.edit(s))},role:"button",name:"edit"},"Edit"),o.createElement(c.zx,{bsSize:"xsmall",bsStyle:"danger",onClick:()=>{window.confirm(`Are you sure you want to delete data adapter "${i}"?`)&&vt.e.delete(t.id).then((()=>vt.e.reloadPage()))},role:"button",name:"delete"},"Delete")))))};function yt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const _t=x.default.div.withConfig({displayName:"DataAdaptersOverview__ScrollContainer",componentId:"sc-1cchn10-0"})(["overflow-x:auto;"]);class Ct extends o.Component{constructor(){super(...arguments),yt(this,"_onPageChange",((e,t)=>{const{pagination:a}=this.props;vt.e.searchPaginated(e,t,a.query)})),yt(this,"_onSearch",((e,t)=>{const{pageSize:a}=this.props.paginationQueryParameter;vt.e.searchPaginated(1,a,e).then(t)})),yt(this,"_onReset",(()=>{const{resetPage:e,pageSize:t}=this.props.paginationQueryParameter;e(),vt.e.searchPaginated(1,t)}))}render(){const{dataAdapters:e,errorStates:t,pagination:a}=this.props;if(!e)return o.createElement(u.$j,{text:"Loading data adapters"});const l=e.map((e=>o.createElement(ft,{key:e.id,adapter:e,error:t.dataAdapters[e.name]})));return o.createElement("div",null,o.createElement(c.X2,{className:"content"},o.createElement(c.JX,{md:12},o.createElement("h2",null,"Configured lookup Data Adapters",o.createElement("span",null," ",o.createElement("small",null,a.total," total"))),o.createElement(u.l9,{onChange:this._onPageChange,totalItems:a.total},o.createElement(u.UI,{onSearch:this._onSearch,onReset:this._onReset,useLoadingState:!0},o.createElement(u.Ox,{trigger:"click",rootClose:!0,placement:"right",overlay:o.createElement(c.J2,{id:"search-query-help",className:ke.popoverWide,title:"Search Syntax Help"},o.createElement("p",null,o.createElement("strong",null,"Available search fields")),o.createElement(c.iA,{condensed:!0},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",null,"Field"),o.createElement("th",null,"Description"))),o.createElement("tbody",null,o.createElement("tr",null,o.createElement("td",null,"id"),o.createElement("td",null,"Data Adapter ID")),o.createElement("tr",null,o.createElement("td",null,"title"),o.createElement("td",null,"The title of the data adapter")),o.createElement("tr",null,o.createElement("td",null,"name"),o.createElement("td",null,"The reference name of the data adapter")),o.createElement("tr",null,o.createElement("td",null,"description"),o.createElement("td",null,"The description of data adapter")))),o.createElement("p",null,o.createElement("strong",null,"Example")),o.createElement("p",null,"Find data adapters by parts of their names:",o.createElement("br",null),o.createElement("kbd",null,"name:geoip"),o.createElement("br",null),o.createElement("kbd",null,"name:geo")),o.createElement("p",null,"Searching without a field name matches against the ",o.createElement("code",null,"title")," field:",o.createElement("br",null),o.createElement("kbd",null,"geoip")," ",o.createElement("br",null),"is the same as",o.createElement("br",null),o.createElement("kbd",null,"title:geoip")))},o.createElement(c.zx,{bsStyle:"link",className:ke.searchHelpButton},o.createElement(u.JO,{name:"question-circle",fixedWidth:!0})))),o.createElement(_t,null,o.createElement(c.iA,{condensed:!0,hover:!0,className:ke.overviewTable},o.createElement("thead",null,o.createElement("tr",null,o.createElement("th",{className:ke.rowTitle},"Title"),o.createElement("th",{className:ke.rowDescription},"Description"),o.createElement("th",{className:ke.rowName},"Name"),o.createElement("th",null,"Throughput"),o.createElement("th",{className:ke.rowActions},"Actions"))),l))))))}}yt(Ct,"propTypes",{dataAdapters:r().array.isRequired,pagination:r().object.isRequired,errorStates:r().object.isRequired,paginationQueryParameter:r().object.isRequired});const St=(0,me.Z)(Ct);var At=a("YyiN4DLW");const Tt=x.default.div.withConfig({displayName:"ConfigSummaryDefinitionListWrapper",componentId:"sc-q06fu3-0"})(["dl{margin-top:10px;dt{float:left;clear:left;}dd{margin-left:185px;word-wrap:break-word;:not(:last-child){border-bottom:1px solid #ececec;margin-bottom:5px;padding-bottom:5px;}}}"]),kt=e=>{let{dataAdapter:t}=e;const[a,l]=o.useState(""),[n,r]=o.useState(null),{loadingScopePermissions:s,scopePermissions:i}=(0,se.Z)(t),u=(0,Qe.Z)("lookupTableAdapters").find((e=>{var a;return e.type===(null===(a=t.config)||void 0===a?void 0:a.type)}));if(!u)return o.createElement("p",null,"Unknown data adapter type ",t.config.type,". Is the plugin missing?");const{title:m,description:d,name:p}=t,h=u.summaryComponent;return o.createElement(c.X2,{className:"content"},o.createElement(c.JX,{md:6},o.createElement("h2",null,m," ",o.createElement("small",null,"(",u.displayName,")")),o.createElement(Tt,null,o.createElement("dl",null,o.createElement("dt",null,"Description"),o.createElement("dd",null,d||o.createElement("em",null,"No description.")))),o.createElement("h4",null,"Configuration"),o.createElement(Tt,null,o.createElement(h,{dataAdapter:t})),!s&&(null==i?void 0:i.is_mutable)&&o.createElement(ne.J,{to:re.ZP.SYSTEM.LOOKUPTABLES.DATA_ADAPTERS.edit(p)},o.createElement(c.zx,{bsStyle:"success",role:"button",name:"edit"},"Edit"))),o.createElement(c.JX,{md:6},o.createElement("h3",null,"Test lookup"),o.createElement("p",null,"You can manually trigger the data adapter using this form. The data will be not cached."),o.createElement("form",{onSubmit:e=>{e.preventDefault(),vt.e.lookup(t.name,a).then((e=>{r(e)}))}},o.createElement("fieldset",null,o.createElement(c.II,{type:"text",id:"key",name:"key",label:"Key",required:!0,onChange:e=>{l((0,At.n6)(e.target))},help:"Key to look up a value for.",value:a}),o.createElement(c.zx,{type:"submit",bsStyle:"success"},"Look up"))),n&&o.createElement("div",null,o.createElement("h4",null,"Lookup result"),o.createElement("pre",null,JSON.stringify(n,null,2)))))};function Pt(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class Nt extends o.Component{constructor(e){super(e),Pt(this,"validationCheckTimer",void 0),Pt(this,"_input",void 0),Pt(this,"updateState",(e=>{this.setState(this._initialState(e))})),Pt(this,"_initialState",(e=>{const t=i.Z.clone(e),{create:a}=this.props;return{generateAdapterName:a,isFormDisabled:!1,dataAdapter:{id:t.id,title:t.title,description:t.description,name:t.name,custom_error_ttl_enabled:t.custom_error_ttl_enabled,custom_error_ttl:t.custom_error_ttl,custom_error_ttl_unit:t.custom_error_ttl_unit,config:t.config}}})),Pt(this,"_clearTimer",(()=>{void 0!==this.validationCheckTimer&&(clearTimeout(this.validationCheckTimer),this.validationCheckTimer=void 0)})),Pt(this,"_setIsFormDisabled",(e=>{this.setState({isFormDisabled:e})})),Pt(this,"_validate",(e=>{const{validate:t}=this.props;this._clearTimer(),t&&(this.validationCheckTimer=setTimeout((()=>t(e)),500))})),Pt(this,"_onChange",(e=>{const{dataAdapter:t}=this.state,a=i.Z.clone(t);a[e.target.name]=(0,At.n6)(e.target);let{generateAdapterName:l}=this.state;l&&"title"===e.target.name&&(a.name=this._sanitizeTitle(a.title)),"name"===e.target.name&&(l=!1),this._validate(a),this.setState({dataAdapter:a,generateAdapterName:l})})),Pt(this,"_onConfigChange",(e=>{const{dataAdapter:t}=this.state,a=i.Z.clone(t);a.config[e.target.name]=(0,At.n6)(e.target),this._validate(a),this.setState({dataAdapter:a})})),Pt(this,"_updateConfig",(e=>{const{dataAdapter:t}=this.state,a=i.Z.clone(t);a.config=e,this._validate(a),this.setState({dataAdapter:a})})),Pt(this,"updateCustomErrorTTL",((e,t,a)=>{this._updateCustomErrorTTL(e,t,a,"custom_error_ttl")})),Pt(this,"_updateCustomErrorTTL",((e,t,a,l)=>{const{dataAdapter:n}=this.state,r=i.Z.clone(n);a&&e?(r[l]=a&&e?e:null,r[`${l}_enabled`]=a):(r[l]=null,r[`${l}_enabled`]=!1),r[`${l}_unit`]=a?t:null,this._validate(r),this.setState({dataAdapter:r})})),Pt(this,"_save",(e=>{e&&e.preventDefault();const{dataAdapter:t}=this.state,{create:a,saved:l}=this.props;let n;n=a?vt.e.create(t):vt.e.update(t),n.then((()=>{l()}))})),Pt(this,"_sanitizeTitle",(e=>e.trim().replace(/\W+/g,"-").toLocaleLowerCase())),Pt(this,"_validationState",(e=>{const{validationErrors:t}=this.props;return t[e]?"error":null})),Pt(this,"_validationMessage",((e,t)=>{const{validationErrors:a}=this.props;return a[e]?o.createElement("div",null,o.createElement("span",null,t)," ",o.createElement("span",null,o.createElement("b",null,a[e][0]))):o.createElement("span",null,t)})),Pt(this,"_renderTitle",((e,t,a)=>{const l=a?"h3":"h2";return o.createElement(l,null,e," ",o.createElement("small",null,"(",t,")"))})),this.state=this._initialState(e.dataAdapter)}componentDidMount(){this._input.getInputDOMNode().focus();const{create:e,dataAdapter:t}=this.props;e||this._validate(t)}componentDidUpdate(e){const{type:t}=this.props;e.type!==t&&this._input.getInputDOMNode().focus();const{dataAdapter:a}=this.props;at().isEqual(a,e.dataAdapter)||this.updateState(a)}componentWillUnmount(){this._clearTimer()}render(){const{dataAdapter:e,isFormDisabled:t}=this.state,{create:a,type:n,title:r}=this.props,s=l.PluginStore.exports("lookupTableAdapters").filter((e=>e.type===n));let i=null,m=null,d=e.config.type;if(s&&s.length>0){const t=s[0];d=t.displayName,i=o.createElement(t.formComponent,{config:e.config,handleFormEvent:this._onConfigChange,updateConfig:this._updateConfig,validationMessage:this._validationMessage,validationState:this._validationState,setDisableFormSubmission:this._setIsFormDisabled}),t.documentationComponent&&(m=o.createElement(t.documentationComponent,{dataAdapterId:e.id}))}let p=null,h=8;return m&&(h=6,p=o.createElement(c.JX,{lg:h},m)),o.createElement(o.Fragment,null,o.createElement("p",null,this._renderTitle(r,d,a)),o.createElement(c.X2,null,o.createElement(c.JX,{lg:h},o.createElement("form",{className:"form form-horizontal",onSubmit:this._save},o.createElement("fieldset",null,o.createElement(c.II,{type:"text",id:"title",name:"title",label:"Title",autoFocus:!0,required:!0,onChange:this._onChange,help:"A short title for this data adapter.",value:e.title,labelClassName:"col-sm-3",ref:e=>{this._input=e},wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"description",name:"description",label:"Description",onChange:this._onChange,help:"Data adapter description.",value:e.description,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"}),o.createElement(c.II,{type:"text",id:"name",name:"name",label:"Name",required:!0,onChange:this._onChange,help:this._validationMessage("name","The name that is being used to refer to this data adapter. Must be unique."),value:e.name,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9",bsStyle:this._validationState("name")}),o.createElement(u.AX,{label:"Custom Error TTL",help:"Define a custom TTL for caching erroneous results. Otherwise the default of 5 seconds is used",update:this.updateCustomErrorTTL,value:e.custom_error_ttl,unit:e.custom_error_ttl_unit||"MINUTES",units:["MILLISECONDS","SECONDS","MINUTES","HOURS","DAYS"],enabled:e.custom_error_ttl_enabled,labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"})),i,o.createElement("fieldset",null,o.createElement(c.X2,null,o.createElement(c.JX,{mdOffset:3,md:9},o.createElement(u.Ow,{submitButtonText:a?"Create adapter":"Update adapter",disabledSubmit:t,onCancel:()=>qe.Z.push(re.ZP.SYSTEM.LOOKUPTABLES.DATA_ADAPTERS.OVERVIEW)})))))),p))}}Pt(Nt,"propTypes",{type:r().string.isRequired,title:r().string.isRequired,saved:r().func.isRequired,create:r().bool,dataAdapter:r().object,validate:r().func,validationErrors:r().object}),Pt(Nt,"defaultProps",{create:!0,dataAdapter:{id:void 0,title:"",description:"",name:"",custom_error_ttl_enabled:!1,custom_error_ttl:null,custom_error_ttl_unit:null,config:{}},validate:null,validationErrors:{}});const wt=Nt;function It(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}class xt extends o.Component{constructor(e){super(e),It(this,"_onTypeSelect",(e=>{const{types:t}=this.props;this.setState({type:e,dataAdapter:{id:null,title:"",name:"",description:"",config:i.Z.clone(t[e].default_config)}})})),this.state={dataAdapter:void 0,type:void 0}}render(){const{types:e,validate:t,validationErrors:a,saved:n}=this.props,{type:r,dataAdapter:s}=this.state,i={};l.PluginStore.exports("lookupTableAdapters").forEach((e=>{i[e.type]=e}));const m=Object.keys(e).map((t=>{const a=e[t];return void 0===i[a.type]?(console.error(`Plugin component for data adapter type ${a.type} is missing - invalid or missing plugin?`),{value:a.type,disabled:!0,label:`${a.type} - missing or invalid plugin`}):{value:a.type,label:i[a.type].displayName}})).sort(((e,t)=>(0,st.S)(e.label.toLowerCase(),t.label.toLowerCase())));return o.createElement("div",null,o.createElement(c.X2,{className:"content"},o.createElement(c.JX,{lg:8},o.createElement("form",{className:"form form-horizontal",onSubmit:()=>{}},o.createElement(c.II,{id:"data-adapter-type-select",label:"Data Adapter Type",required:!0,autoFocus:!0,help:"The type of data adapter to configure.",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},o.createElement(u.Ph,{placeholder:"Select Data Adapter Type",clearable:!1,options:m,matchProp:"label",onChange:this._onTypeSelect,value:null}))))),s&&o.createElement(c.X2,{className:"content"},o.createElement(c.JX,{lg:12},o.createElement(wt,{dataAdapter:s,type:r,create:!0,title:"Configure Adapter",validate:t,validationErrors:a,saved:n}))))}}It(xt,"propTypes",{saved:r().func.isRequired,types:r().object.isRequired,validate:r().func,validationErrors:r().object}),It(xt,"defaultProps",{validate:null,validationErrors:{}});const Rt=xt,Ot=e=>{let{dataAdapters:t}=e;const[,{value:a,touched:l,error:n},{setTouched:r,setValue:s}]=(0,Y.useField)("data_adapter_id"),i=t.map((e=>({value:e.id,label:`${e.title} (${e.name})`}))).sort(((e,t)=>(0,st.S)(e.label.toLowerCase(),t.label.toLowerCase()))),m=l?n:"";return o.createElement("fieldset",null,o.createElement(c.II,{id:"data-adapter-select",label:"Data Adapter",required:!0,autoFocus:!0,bsStyle:m?"error":void 0,help:m||"Select an existing data adapter",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},o.createElement(u.Ph,{placeholder:"Select a data adapter",clearable:!1,options:i,matchProp:"label",onBlur:()=>r(!0),onChange:s,value:a})))};Ot.propTypes={dataAdapters:r().array},Ot.defaultProps={dataAdapters:[]};const Lt=Ot,Dt=pt()({displayName:"DataAdaptersContainer",propTypes:{children:r().oneOfType([r().arrayOf(r().node),r().node])},mixins:[gt().connect(vt.m)],getDefaultProps:()=>({children:null}),componentDidMount(){vt.e.searchPaginated(1,1e4,null)},render(){if(!this.state.dataAdapters)return o.createElement(u.$j,null);const e=o.Children.map(this.props.children,(e=>o.cloneElement(e,{dataAdapters:this.state.dataAdapters,pagination:this.state.pagination})));return o.createElement("div",null,e)}});var qt=a("WOuTULJa"),Bt={};Bt.styleTagTransform=Se(),Bt.setAttributes=fe(),Bt.insert=ve().bind(null,"head"),Bt.domAPI=ge(),Bt.insertStyleElement=_e();pe()(qt.Z,Bt);const Zt=qt.Z&&qt.Z.locals?qt.Z.locals:void 0,Ut=e=>{let{errorText:t,title:a="Error",placement:l="bottom"}=e;const n=o.createElement(c.J2,{id:"error-popover",title:a,className:Zt.overlay},t);return o.createElement(u.Ox,{trigger:["hover","focus"],placement:l,overlay:n},o.createElement("span",{className:Zt.trigger},o.createElement(u.JO,{name:"exclamation-triangle",className:"text-danger"})))}},"ECqdgSQ+":(e,t,a)=>{"use strict";a.d(t,{Z:()=>c});var l=a("DUKaTDO2"),n=a("OqsMdpSm"),r=a("0wQfx7YJ"),o=a("rkoyttmq"),s=a("4af3+9mh");function i(){return(0,n.ZP)("GET",(0,r.DC)(o.Z.EntityScopeController.getScope().url))}const c=e=>{var t;const{data:a,isLoading:n,error:r}=(0,l.useQuery)(["scope-permissions"],i,{onError:()=>s.Z.error(r.message),retry:1,cacheTime:108e5,staleTime:108e5}),o=(null==e||null===(t=e._scope)||void 0===t?void 0:t.toUpperCase())||"DEFAULT";return{loadingScopePermissions:n,scopePermissions:n?{is_mutable:!1}:a.entity_scopes[o]}}},JRlAvJim:(e,t,a)=>{"use strict";a.d(t,{$:()=>u,Z:()=>c});var l=a("JnTtTRmZ"),n=a.n(l),r=a("4af3+9mh"),o=a("0wQfx7YJ"),s=a("OqsMdpSm"),i=a("xc00RsLr");const c=(0,i.ei)("core.LookupTableCaches",(()=>n().createActions({searchPaginated:{asyncResult:!0},reloadPage:{asyncResult:!0},get:{asyncResult:!0},create:{asyncResult:!0},delete:{asyncResult:!0},update:{asyncResult:!0},getTypes:{asyncResult:!0},validate:{asyncResult:!0}}))),u=(0,i.dS)("core.LookupTableCaches",(()=>n().createStore({listenables:[c],cache:null,caches:null,types:null,pagination:{page:1,per_page:10,total:0,count:0,query:null},validationErrors:{},getInitialState(){return this.getState()},getState(){return{cache:this.cache,caches:this.caches,types:this.types,pagination:this.pagination,validationErrors:this.validationErrors}},propagateChanges(){this.trigger(this.getState())},reloadPage(){const e=this.searchPaginated(this.pagination.page,this.pagination.per_page,this.pagination.query);return c.reloadPage.promise(e),e},searchPaginated(e,t,a){let l;l=a?this._url(`caches?page=${e}&per_page=${t}&query=${encodeURIComponent(a)}`):this._url(`caches?page=${e}&per_page=${t}`);const n=(0,s.ZP)("GET",l);return n.then((e=>{this.pagination={count:e.count,total:e.total,page:e.page,per_page:e.per_page,query:e.query},this.caches=e.caches,this.propagateChanges()}),this._errorHandler("Fetching lookup table caches failed","Could not retrieve the lookup caches")),c.searchPaginated.promise(n),n},get(e){const t=this._url(`caches/${e}`),a=(0,s.ZP)("GET",t);return a.then((e=>{this.cache=e,this.propagateChanges()}),this._errorHandler(`Fetching lookup table cache ${e} failed`,"Could not retrieve lookup table cache")),c.get.promise(a),a},create(e){const t=this._url("caches"),a=(0,s.ZP)("POST",t,e);return a.then((e=>{this.cache=e,this.propagateChanges()}),this._errorHandler("Creating lookup table cache failed",`Could not create lookup table cache "${e.name}"`)),c.create.promise(a),a},update(e){const t=this._url(`caches/${e.id}`),a=(0,s.ZP)("PUT",t,e);return a.then((e=>{this.cache=e,this.propagateChanges()}),this._errorHandler("Updating lookup table cache failed",`Could not update lookup table cache "${e.name}"`)),c.update.promise(a),a},getTypes(){const e=this._url("types/caches"),t=(0,s.ZP)("GET",e);return t.then((e=>{this.types=e,this.propagateChanges()}),this._errorHandler("Fetching available types failed","Could not fetch the available lookup table cache types")),c.getTypes.promise(t),t},delete(e){const t=this._url(`caches/${e}`),a=(0,s.ZP)("DELETE",t);return a.catch(this._errorHandler("Deleting lookup table cache failed",`Could not delete lookup table cache "${e}"`)),c.delete.promise(a),a},validate(e){const t=this._url("caches/validate"),a=(0,s.ZP)("POST",t,e);return a.then((e=>{this.validationErrors=e.errors,this.propagateChanges()}),this._errorHandler("Lookup table cache validation failed",`Could not validate lookup table cache "${e.name}"`)),c.validate.promise(a),a},_errorHandler:(e,t,a)=>l=>{let n;try{n=l.additional.body.message}catch(e){n=l.message}r.Z.error(`${e}: ${n}`,t),a&&a(l)},_url:e=>o.DC(`/system/lookup/${e}`)})))},fc2k63r4:(e,t,a)=>{"use strict";a.d(t,{e:()=>c,m:()=>u});var l=a("JnTtTRmZ"),n=a.n(l),r=a("4af3+9mh"),o=a("0wQfx7YJ"),s=a("OqsMdpSm"),i=a("xc00RsLr");const c=(0,i.ei)("core.LookupTableDataAdapters",(()=>n().createActions({searchPaginated:{asyncResult:!0},reloadPage:{asyncResult:!0},get:{asyncResult:!0},create:{asyncResult:!0},delete:{asyncResult:!0},update:{asyncResult:!0},getTypes:{asyncResult:!0},lookup:{asyncResult:!0},validate:{asyncResult:!0}}))),u=(0,i.dS)("core.LookupTableDataAdapters",(()=>n().createStore({listenables:[c],dataAdapter:null,dataAdapters:void 0,types:null,pagination:{page:1,per_page:10,total:0,count:0,query:null},lookupResult:null,validationErrors:{},getInitialState(){return this.getState()},getState(){return{dataAdapter:this.dataAdapter,dataAdapters:this.dataAdapters,lookupResult:this.lookupResult,types:this.types,pagination:this.pagination,validationErrors:this.validationErrors}},propagateChanges(){this.trigger(this.getState())},reloadPage(){const e=this.searchPaginated(this.pagination.page,this.pagination.per_page,this.pagination.query);return c.reloadPage.promise(e),e},searchPaginated(e,t,a){let l;l=a?this._url(`adapters?page=${e}&per_page=${t}&query=${encodeURIComponent(a)}`):this._url(`adapters?page=${e}&per_page=${t}`);const n=(0,s.ZP)("GET",l);return n.then((e=>{this.pagination={count:e.count,total:e.total,page:e.page,per_page:e.per_page,query:e.query},this.dataAdapters=e.data_adapters,this.propagateChanges()}),this._errorHandler("Fetching lookup table data adapters failed","Could not retrieve the lookup dataAdapters")),c.searchPaginated.promise(n),n},get(e){const t=this._url(`adapters/${e}`),a=(0,s.ZP)("GET",t);return a.then((e=>{this.dataAdapter=e,this.propagateChanges()}),this._errorHandler(`Fetching lookup table data adapter ${e} failed`,"Could not retrieve lookup table data adapter")),c.get.promise(a),a},create(e){const t=this._url("adapters"),a=(0,s.ZP)("POST",t,e);return a.then((e=>{this.dataAdapter=e,this.propagateChanges()}),this._errorHandler("Creating lookup table data adapter failed",`Could not create lookup table data adapter "${e.name}"`)),c.create.promise(a),a},update(e){const t=this._url(`adapters/${e.id}`),a=(0,s.ZP)("PUT",t,e);return a.then((e=>{this.dataAdapter=e,this.propagateChanges()}),this._errorHandler("Updating lookup table data adapter failed",`Could not update lookup table data adapter "${e.name}"`)),c.update.promise(a),a},getTypes(){const e=this._url("types/adapters"),t=(0,s.ZP)("GET",e);return t.then((e=>{this.types=e,this.propagateChanges()}),this._errorHandler("Fetching available types failed","Could not fetch the available lookup table data adapter types")),c.getTypes.promise(t),t},delete(e){const t=this._url(`adapters/${e}`),a=(0,s.ZP)("DELETE",t);return a.catch(this._errorHandler("Deleting lookup table data adapter failed",`Could not delete lookup table data adapter "${e}"`)),c.delete.promise(a),a},lookup(e,t){const a=(0,s.ZP)("GET",this._url(`adapters/${e}/query?key=${encodeURIComponent(t)}`));return a.then((e=>{this.lookupResult=e,this.propagateChanges()}),this._errorHandler("Lookup failed",`Could not lookup value for key "${t}" in lookup table data adapter "${e}"`)),c.lookup.promise(a),a},validate(e){const t=this._url("adapters/validate"),a=(0,s.ZP)("POST",t,e);return a.then((e=>{this.validationErrors=e.errors,this.propagateChanges()}),this._errorHandler("Lookup table data adapter validation failed",`Could not validate lookup table data adapter "${e.name}"`)),c.validate.promise(a),a},_errorHandler:(e,t,a)=>l=>{let n;try{n=l.additional.body.message}catch(e){n=l.message}r.Z.error(`${e}: ${n}`,t),a&&a(l)},_url:e=>o.DC(`/system/lookup/${e}`)})))},Lzn6DvfV:(e,t,a)=>{"use strict";a.d(t,{H:()=>u,m:()=>m});var l=a("JnTtTRmZ"),n=a.n(l),r=a("4af3+9mh"),o=a("4sldgQy6"),s=a("0wQfx7YJ"),i=a("OqsMdpSm"),c=a("xc00RsLr");const u=(0,c.ei)("core.LookupTables",(()=>n().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}}))),m=(0,c.dS)("core.LookupTables",(()=>n().createStore({listenables:[u],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 e=this.searchPaginated(this.pagination.page,this.pagination.per_page,this.pagination.query);return u.reloadPage.promise(e),e},searchPaginated(e,t,a){let l=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const n=this._url((0,o.Z)("tables",e,t,a,{resolve:l})),r=(0,i.ZP)("GET",n);return r.then((e=>{this.pagination={count:e.count,total:e.total,page:e.page,per_page:e.per_page,query:e.query},this.tables=e.lookup_tables,this.caches=e.caches,this.dataAdapters=e.data_adapters,this.propagateChanges()}),this._errorHandler("Fetching lookup tables failed","Could not retrieve the lookup tables")),u.searchPaginated.promise(r),r},get(e){const t=this._url(`tables/${e}?resolve=true`),a=(0,i.ZP)("GET",t);return a.then((e=>{const t=e.lookup_tables[0];this.table=t,this.cache=e.caches[t.cache_id],this.dataAdapter=e.data_adapters[t.data_adapter_id],this.propagateChanges()}),this._errorHandler(`Fetching lookup table ${e} failed`,"Could not retrieve lookup table")),u.get.promise(a),a},create(e){const t=this._url("tables"),a=(0,i.ZP)("POST",t,e);return a.catch(this._errorHandler("Creating lookup table failed",`Could not create lookup table "${e.name}"`)),u.create.promise(a),a},update(e){const t=this._url(`tables/${e.id}`),a=(0,i.ZP)("PUT",t,e);return a.catch(this._errorHandler("Updating lookup table failed",`Could not update lookup table "${e.name}"`)),u.update.promise(a),a},delete(e){const t=this._url(`tables/${e}`),a=(0,i.ZP)("DELETE",t);return a.catch(this._errorHandler("Deleting lookup table failed",`Could not delete lookup table "${e}"`)),u.delete.promise(a),a},getErrors(e,t,a){const l={};e&&(l.tables=e),t&&(l.caches=t),a&&(l.data_adapters=a);const n=(0,i.ZP)("POST",this._url("errorstates"),l);return n.then((e=>{this.errorStates={tables:e.tables||{},caches:e.caches||{},dataAdapters:e.data_adapters||{}},this.propagateChanges()}),this._errorHandler("Fetching lookup table error state failed.","Could not error states")),u.getErrors.promise(n),n},lookup(e,t){const a=(0,i.ZP)("GET",this._url(`tables/${e}/query?key=${encodeURIComponent(t)}`));return a.then((e=>{this.lookupResult=e,this.propagateChanges()}),this._errorHandler("Lookup failed",`Could not lookup value for key "${t}" in lookup table "${e}"`)),u.lookup.promise(a),a},purgeKey(e,t){const a=(0,i.ZP)("POST",this._urlClusterWise(`tables/${e.id}/purge?key=${encodeURIComponent(t)}`));return a.then((()=>{r.Z.success(`Purging cache key "${t}" for lookup table "${e.name}"`,"Success!")}),this._errorHandler(`Could not purge cache for key "${t}" in lookup table "${e.name}"`,"Failed!")),u.purgeKey.promise(a),a},purgeAll(e){const t=(0,i.ZP)("POST",this._urlClusterWise(`tables/${e.id}/purge`));return t.then((()=>{r.Z.success(`Purging cache for lookup table "${e.name}"`,"Success!")}),this._errorHandler(`Could not purge cache for lookup table "${e.name}"`,"Failed!")),u.purgeAll.promise(t),t},validate(e){const t=this._url("tables/validate"),a=(0,i.ZP)("POST",t,e);return a.then((e=>{this.validationErrors=e.errors,this.propagateChanges()}),this._errorHandler("Lookup table validation failed",`Could not validate lookup table "${e.name}"`)),u.validate.promise(a),a},_errorHandler:(e,t,a)=>l=>{try{if(l.additional.body[0].message_template)return}catch(e){}let n;try{n=l.additional.body.message}catch(e){n=l.message}r.Z.error(`${e}: ${n}`,t),a&&a(l)},_url:e=>(0,s.DC)(`/system/lookup/${e}`),_urlClusterWise:e=>(0,s.DC)(`/cluster/system/lookup/${e}`)})))},WOuTULJa:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var l=a("pmX897Fv"),n=a.n(l),r=a("DjJvgDaP"),o=a.n(r)()(n());o.push([e.id,"/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\n._WOp2bWqXDYrxvBkNQVa {\n    max-width: 400px;\n}\n\n.ZB8sCgEwW7KZwhU6vhHF {\n    margin-right: 5px;\n}\n","",{version:3,sources:["webpack://./src/components/lookup-tables/ErrorPopover.css"],names:[],mappings:"AAAA;;;;;;;;;;;;;;;EAeE;AACF;IACI,gBAAgB;AACpB;;AAEA;IACI,iBAAiB;AACrB",sourcesContent:["/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\n:local(.overlay) {\n    max-width: 400px;\n}\n\n:local(.trigger) {\n    margin-right: 5px;\n}\n"],sourceRoot:""}]),o.locals={overlay:"_WOp2bWqXDYrxvBkNQVa",trigger:"ZB8sCgEwW7KZwhU6vhHF"};const s=o},AJXifzOX:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var l=a("pmX897Fv"),n=a.n(l),r=a("DjJvgDaP"),o=a.n(r)()(n());o.push([e.id,"/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\n.eooimJB8iUwv4GuS5OgP {\n    cursor: help;\n    padding: 0 0 0 2px;\n    margin-left: 5px;\n}\n\n.EM8rNPeHI3I13MdYidzw {\n    max-width: 500px;\n    min-width: 350px;\n}\n\n/* styles for table columns */\n.oNIxQlLcjvvFY27jyODI {\n    width: 15%;\n}\n.jXZIhUCAUZtfWZKKiLy0 {\n    max-width: 50%;\n    width: 35%\n}\n.Ii_DwC6G4wRm7thBYSKE {\n    width: 15%;\n}\n.q54g6XMj1D9X2J48jgrw {\n    width: 15%;\n}\n.wFLgXxYT9cnZwrNRg6DJ {\n    width: 15%;\n}\n.mk2GxDtbjbYu9RWQh_nL {\n    min-width: 100px;\n}\n\noverviewTable {\n    width: 100%;\n    table-layout: fixed;\n}\n","",{version:3,sources:["webpack://./src/components/lookup-tables/Overview.css"],names:[],mappings:"AAAA;;;;;;;;;;;;;;;EAeE;AACF;IACI,YAAY;IACZ,kBAAkB;IAClB,gBAAgB;AACpB;;AAEA;IACI,gBAAgB;IAChB,gBAAgB;AACpB;;AAEA,6BAA6B;AAC7B;IACI,UAAU;AACd;AACA;IACI,cAAc;IACd;AACJ;AACA;IACI,UAAU;AACd;AACA;IACI,UAAU;AACd;AACA;IACI,UAAU;AACd;AACA;IACI,gBAAgB;AACpB;;AAEA;IACI,WAAW;IACX,mBAAmB;AACvB",sourcesContent:["/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\n:local(.searchHelpButton) {\n    cursor: help;\n    padding: 0 0 0 2px;\n    margin-left: 5px;\n}\n\n:local(.popoverWide) {\n    max-width: 500px;\n    min-width: 350px;\n}\n\n/* styles for table columns */\n:local(.rowTitle) {\n    width: 15%;\n}\n:local(.rowDescription) {\n    max-width: 50%;\n    width: 35%\n}\n:local(.rowName) {\n    width: 15%;\n}\n:local(.rowCache) {\n    width: 15%;\n}\n:local(.rowAdapter) {\n    width: 15%;\n}\n:local(.rowActions) {\n    min-width: 100px;\n}\n\n:local(overviewTable) {\n    width: 100%;\n    table-layout: fixed;\n}\n"],sourceRoot:""}]),o.locals={searchHelpButton:"eooimJB8iUwv4GuS5OgP",popoverWide:"EM8rNPeHI3I13MdYidzw",rowTitle:"oNIxQlLcjvvFY27jyODI",rowDescription:"jXZIhUCAUZtfWZKKiLy0",rowName:"Ii_DwC6G4wRm7thBYSKE",rowCache:"q54g6XMj1D9X2J48jgrw",rowAdapter:"wFLgXxYT9cnZwrNRg6DJ",rowActions:"mk2GxDtbjbYu9RWQh_nL"};const s=o},IcUPdRuX:(e,t,a)=>{var l=a("1delaY+M"),n=a("nFQyKob5");e.exports=function e(t,a,r,o,s){var i=-1,c=t.length;for(r||(r=n),s||(s=[]);++i0&&r(u)?a>1?e(u,a-1,r,o,s):l(s,u):o||(s[s.length]=u)}return s}},OQB6cBJJ:(e,t,a)=>{var l=a("+ERuhDrR"),n=a("w7+AQV2V"),r=a("PUadzYY/"),o=a("Iv0vcObx");e.exports=function(e,t){return t=l(t,e),null==(e=r(e,t))||delete e[o(n(t))]}},VIZIiiaA:(e,t,a)=>{var l=a("JZOQkEtL");e.exports=function(e){return l(e)?void 0:e}},vjlxATGD:(e,t,a)=>{var l=a("Jy5RbH6g"),n=a("WW2/Wle+"),r=a("p3SNfEdf");e.exports=function(e){return r(n(e,void 0,l),e+"")}},nFQyKob5:(e,t,a)=>{var l=a("gOYIjkiZ"),n=a("6ZUku2aP"),r=a("8u9vblRK"),o=l?l.isConcatSpreadable:void 0;e.exports=function(e){return r(e)||n(e)||!!(o&&e&&e[o])}},"PUadzYY/":(e,t,a)=>{var l=a("+Bmyn077"),n=a("eSMJJvtd");e.exports=function(e,t){return t.length<2?e:l(e,n(t,0,-1))}},Jy5RbH6g:(e,t,a)=>{var l=a("IcUPdRuX");e.exports=function(e){return(null==e?0:e.length)?l(e,1):[]}},"w7+AQV2V":e=>{e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},RjO1iR6D:(e,t,a)=>{var l=a("4FGLTY2N"),n=a("8U3oBBH1"),r=a("OQB6cBJJ"),o=a("+ERuhDrR"),s=a("kTyaawi/"),i=a("VIZIiiaA"),c=a("vjlxATGD"),u=a("7XCK84aZ"),m=c((function(e,t){var a={};if(null==e)return a;var c=!1;t=l(t,(function(t){return t=o(t,e),c||(c=t.length>1),t})),s(e,u(e),a),c&&(a=n(a,7,i));for(var m=t.length;m--;)r(a,t[m]);return a}));e.exports=m}}]);
//# sourceMappingURL=325e2d4b-5299.91c4d61edf1fd471af4e.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy