userAgent
This commit is contained in:
parent
02ecedcd74
commit
c08b4a5662
1 changed files with 3 additions and 3 deletions
|
|
@ -21,9 +21,9 @@ const escapeCSVValue = value => {
|
||||||
return value || '';
|
return value || '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const logToCSV = (rayId, ip, country = 'N/A', hostname, endpoint, useragent, actionTaken = 'N/A', status = 'N/A', sefinekAPI) => {
|
const logToCSV = (rayId, ip, country = 'N/A', hostname, endpoint, userAgent, actionTaken = 'N/A', status = 'N/A', sefinekAPI) => {
|
||||||
checkCSVSize();
|
checkCSVSize();
|
||||||
const logLine = `${new Date().toISOString()},${rayId},${ip},${country},${hostname},${escapeCSVValue(endpoint)},${escapeCSVValue(useragent)},${actionTaken.toUpperCase()},${status},${sefinekAPI || false}`;
|
const logLine = `${new Date().toISOString()},${rayId},${ip},${country},${hostname},${escapeCSVValue(endpoint)},${escapeCSVValue(userAgent)},${actionTaken.toUpperCase()},${status},${sefinekAPI || false}`;
|
||||||
fs.appendFileSync(CSV_FILE_PATH, logLine + '\n');
|
fs.appendFileSync(CSV_FILE_PATH, logLine + '\n');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@ const readReportedIPs = () => {
|
||||||
country: parts[3],
|
country: parts[3],
|
||||||
hostname: parts[4],
|
hostname: parts[4],
|
||||||
endpoint: parts[5],
|
endpoint: parts[5],
|
||||||
useragent: parts[6].replace(/(^"|"$)/g, ''),
|
userAgent: parts[6].replace(/(^"|"$)/g, ''),
|
||||||
action: parts[7],
|
action: parts[7],
|
||||||
status: parts[8],
|
status: parts[8],
|
||||||
sefinekAPI: parts[9] === 'true',
|
sefinekAPI: parts[9] === 'true',
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue