Skip to content

Commit

Permalink
1.增加grok相关的校验
Browse files Browse the repository at this point in the history
  • Loading branch information
zhonghuiping authored and wonderflow committed Oct 17, 2017
1 parent 00dbadc commit cb57cad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion logkitweb/src/components/parserConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,9 @@ class Parser extends Component {
const {getFieldsValue} = this.props.form;
let data = getFieldsValue();
if (this.state.currentOption === 'grok') {
data[this.state.currentOption].grok_custom_patterns = window.btoa(data[this.state.currentOption].grok_custom_patterns)
if (data[this.state.currentOption].grok_custom_patterns != '' && data[this.state.currentOption].grok_custom_patterns != undefined) {
data[this.state.currentOption].grok_custom_patterns = window.btoa(data[this.state.currentOption].grok_custom_patterns)
}
}
const requestData = {
type: this.state.currentOption,
Expand Down
5 changes: 4 additions & 1 deletion logkitweb/src/createContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ class Create extends Component {
}
let nodeData = config.getNodeData()
if (nodeData && nodeData.parser.type === 'grok') {
nodeData.parser.grok_custom_patterns = window.btoa(nodeData.parser.grok_custom_patterns)
if (nodeData.parser.grok_custom_patterns != '' && nodeData.parser.grok_custom_patterns != undefined) {
nodeData.parser.grok_custom_patterns = window.btoa(nodeData.parser.grok_custom_patterns)
}

}

let data = {
Expand Down

0 comments on commit cb57cad

Please sign in to comment.