Data source with type custom (Load by script) is importing only one record.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 12:30 AM
I have created a data source as custom (Load by script) type but when clicking on
- Test Load 20 Records
- Load All Records , its processing only one record.
Data loader script is as below :
(function loadData(import_set_table, data_source, import_log, last_success_import_time) {
var map = {
device_name: "",
last_login_user: "",
model_id: "",
device_typ: "",
os: "",
last_seen: "",
ram: "",
serial_number: "",
ad_site: "",
cpus: "",
manufacturer: "",
os_acrhutecture: ""
};
import_set_table.getMaximumRows();
import_set_table.insert(map);
})(import_set_table, data_source, import_log, last_success_import_time);
any insights what i am doing wrong ..?
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2024 12:55 AM
Hello @Imtiyaj Mulla .
The empty mapping willl not be enough in this case hence it is just inserting 1 record with empty data
you need to bring in the data and map it here
e.g
var dataList = new QRadarRestUtil(); // Calling the script include from where the data will come
dataList.forEach(function(data) { // this is for all the records
var map = {
// mapping of fields
device_name: "data.value1",
last_login_user: "data.value2",
model_id: "data.value3",
device_typ: "data.value4",
os: "data.value5",
last_seen: "data.value6",
ram: "data.value7",
serial_number: "data.value8"
};
import_set_table.insert(map);
});
Please modifying your code according and check.
Thank youi,
Omkar
If I was able to help you with your case, please click the Thumb Icon and mark as Correct.