Cisco Cisco Firepower Management Center 4000 Entwickleranleitung

Seite von 102
 
2-40
FireSIGHT System Host Input API Guide
 
Chapter 2      Using the Host Input API 
  Example Host Input API Scripts
Example Host Input API Scripts
The following code samples illustrate how you might construct a script to import data using the host 
input API. 
The following sections, in sequential order, show each portion of the script:
  •
  •
  •
  •
  •
  •
  •
  •
  •
  •
  •
Example: Invoking the Host Input Module
The example script starts by declaring the use of the HostInput Perl module: 
#!/usr/bin/perl
use SF::SFDataCorrelator::HostInput;
Example: Setting the Source Type
The example script next initiates the 
$source_type_id
 variable and sets it to 
Scanner
# Set the Source Type
my $source_type_id = SF::SFDataCorrelator::HostInput::GetSourceTypeIDByName 
('Scanner');
This source type value is used in most of the host input function calls. In host input events resulting from 
this input function, the Source Type lists as 
Application
.
Example: Setting the Source ID
After the 
$source_type_id
 value is set, the example script uses the 
GetSourceAppIDByName
 function to 
set the 
$source_id
 value to 
AssetManageApp
# Set the Application ID
SF::SFDataCorrelator::HostInput::SetCurrentSource ($source_type_id,"CustomApp");
# Retrieve the Application ID you set
my $source_id =
SF::SFDataCorrelator::HostInput::GetCurrentSource();
This source ID value is used in most of the host input function calls. In host input events resulting from 
this input function, the Source Type lists as 
Application: AssetManageApp
.