Skip to content
This repository has been archived by the owner on Apr 19, 2021. It is now read-only.

Commit

Permalink
capme should check to see if uid field is an array
Browse files Browse the repository at this point in the history
  • Loading branch information
dougburks committed Mar 26, 2018
1 parent 1de8529 commit 21df730
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions var/www/so/capme/.inc/callback-elastic.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ function elastic_command($elastic_host, $elastic_port, $type, $bro_query, $st_es
// Let's first check to see if it's a Bro log that has a CID in the uid field.
if (isset($elastic_response_object["hits"]["hits"][0]["_source"]["uid"]) ) {
$uid = $elastic_response_object["hits"]["hits"][0]["_source"]["uid"];
// Some bro_files logs are coming back with uid as an array
// If that's the case here, then grab the first element in that array
if (is_array($uid)) {
$uid = $elastic_response_object["hits"]["hits"][0]["_source"]["uid"][0];
}
// A Bro CID should be alphanumeric and begin with the letter C
if (ctype_alnum($uid)) {
if (substr($uid,0,1)=="C") {
Expand Down

0 comments on commit 21df730

Please sign in to comment.