Example: Ingesting Data
This section will help you get started with devices to ingest data with specific protocols, walking you through a common use case.
For a detailed discussion of devices, see this section.
Scenario
Use UDP as the listening protocol.
Setup and Trial
We will create a device that will receive data from Syslog using an insecure UDP connection.
Create the device configuration
Create a file named from-syslog-udp.yml in our working directory, and then open it with a text editor to enter the following:
devices:
- id: 1
name: from_syslog_udp
type: syslog
status: true
properties:
protocol: udp
address: 127.0.0.1
port: 514
This YAML code specifies that this is a Syslog device, that it will use UDP as its protocol, and that it will be listening on port 514. You can enter any integer as the id value.
However, we also need to define a target that the ingested data willl be directed to, and a route combining the device and the target.
Create a file named to-console.yml and add the following target definition to it:
targets:
- name: to_console
status: true
type: console
Now create a file named syslog-to-console.yml and add the following route definition to it.
routes:
- name: syslog_to_console
devices:
- name: from_syslog_udp
targets:
- name: to_console
To see the ingested data, your must route the stream to a specific destination! For a detailed discussion of Routes, see this section.
We are now ready to try our configuration.
Run the UDP device
Open a terminal and enter the following in the command line to start Director:
- PowerShell
- Bash
.\vmetric-director -background
./vmetric-director -background
This will start Director as a background process which you can verify as indicated before. Now enter:
- PowerShell
- Bash
.\vmetric-director -console
./vmetric-director -console
The -console switch will print status messages to the terminal.
After you press
Run the configuration
We can now run the reception using Director's cross-platform generator mode.
Open a new terminal and enter the following in the command line:
- PowerShell
- Bash
- Using generator mode
.\vmetric-director -generator -now -mode syslog -count 1 -address "127.0.0.1:514" -message="Hello world"
- Using generator mode
./vmetric-director -generator -now -mode syslog -count 1 -address "127.0.0.1:514" -message="Hello world"
- Using System Logger
logger -n 127.0.0.1 -P 514 "Hello world"
If you are using the generator mode, after you press
- PowerShell
- Bash
1 message sent successfully in 11 ms with 0 error(s) at 2025-06-02 01:54:02.0349011 +0300 +03 m=+2.821324601
2 messages sent successfully since 2025-06-02 01:54:00 +0300 +03
1 message sent successfully in 11 ms with 0 error(s) at 2025-06-02 01:54:02.0349011 +0300 +03 m=+2.821324601
2 messages sent successfully since 2025-06-02 01:54:00 +0300 +03
After sending a limited number of messages—say 5 of them—press
If you now switch back to Director's terminal, you will see each sent message (i.e. "Hello world") as received on the console:
- PowerShell
- Bash
<1> 2025-06-02T08:33:28+03:00 VirtualMetric Test[3872]: Hello world
<1> 2025-06-02T08:33:28+03:00 VirtualMetric Test[3872]: Hello world
Monitoring
Check that the example worked by verifying:
- Messages appeared in Director's console output
- No error files in the directory indicated here
If you see the "Hello world" messages displayed, data ingestion is working correctly.
In the next section, we will create a secure device to ingest the data.