Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
NdS-Research-Facilities authored Jul 14, 2016
1 parent 7dae006 commit 7962d50
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
Binary file added bsn11test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
51 changes: 51 additions & 0 deletions eu.ndsrf.caf.bsn11test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<content>
<custom_function>
<namespace>ndsrf</namespace>
<name>isBSN</name>
<return_type>boolean</return_type>
<parameter_types>string</parameter_types>
<execute_function_name>isBSN</execute_function_name>
<init_function_name>onInit</init_function_name>
<script_engine>javascript</script_engine>
<script>
//
// Created by : [email protected]
//
// install with:
// /opt/qradar/bin/contentManagement.pl -a update -f eu.ndsrf.caf.bsn11proef.xml
//
// AQL usage sample:
// select "BSN" as ii, NDSRF::ISBSN(ii) as ff from events last 1 DAYS
//
function onInit() {
};

function isBSN(in_BSN) {
var BSN = false;
try {
bsnnr=in_BSN.toString();
var checksum=0;
if(isNaN(bsnnr) || bsnnr.length!=9){
BSN=false;
}
else{
for(var i=0;i&lt;8;i++){
checksum += (bsnnr.charAt(i)*(9-i));
}
checksum -= bsnnr.charAt(8);
if(checksum%11==0) {
BSN=true;
}
}
}
catch(err) {
BSN = false;
}
finally {
return BSN;
}
}
</script>
<username>admin</username>
</custom_function>
</content>

0 comments on commit 7962d50

Please sign in to comment.