Skip to content

Commit

Permalink
Not sending src/dst net/name if they are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
eugpermar committed Apr 10, 2015
1 parent e17f878 commit fc3035b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/output-plugins/spo_alert_json.c
Original file line number Diff line number Diff line change
Expand Up @@ -1581,15 +1581,17 @@ static int printElementWithTemplate(Packet *p, void *event, uint32_t event_type,
case SRC_NET:
case DST_NET:
{
Number_str_assoc * ip_net = SearchIpStr(ip,jsonData->nets,NETWORKS);
KafkaLog_Puts(kafka,ip_net?ip_net->number_as_str:templateElement->defaultValue);
Number_str_assoc *ip_net = SearchIpStr(ip,jsonData->nets,NETWORKS);
if(ip_net)
KafkaLog_Puts(kafka,ip_net->number_as_str);
}
break;
case SRC_NET_NAME:
case DST_NET_NAME:
{
Number_str_assoc * ip_net = SearchIpStr(ip,jsonData->nets,NETWORKS);
KafkaLog_Puts(kafka,ip_net?ip_net->human_readable_str:templateElement->defaultValue);
Number_str_assoc *ip_net = SearchIpStr(ip,jsonData->nets,NETWORKS);
if(ip_net)
KafkaLog_Puts(kafka,ip_net->human_readable_str);
}
break;

Expand Down

0 comments on commit fc3035b

Please sign in to comment.