Skip to content

Commit

Permalink
Added three right click fields: (arkime#523)
Browse files Browse the repository at this point in the history
- %UCTEXT%   - %TEXT% in uppercase
- %ISOSTART% - startTime in ISO8601 format (useful for linking to Kibana)
- %ISOSTOP%  - stopTime in ISO8601 format (useful for linking to Kibana)
  • Loading branch information
MattCarothers authored and awick committed Sep 7, 2016
1 parent 6a2ecfa commit 4ec0293
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion viewer/public/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -980,12 +980,19 @@ $(document).ready(function() {
// in a substitution
var urlParams = parseUrlParams();
var dateparams;
var isostart;
var isostop;
if (urlParams.startTime && urlParams.stopTime) {
dateparams = "startTime=" + urlParams.startTime +
"&stopTime=" + urlParams.stopTime
"&stopTime=" + urlParams.stopTime;
isostart = new Date(parseInt(urlParams.startTime) * 1000);
isostop = new Date(parseInt(urlParams.stopTime) * 1000);
}
else {
dateparams = "date=" + urlParams.date;
isostart = new Date();
isostart.setHours(isostart.getHours() - parseInt(urlParams.date));
isostop = new Date();
}

for (var key in molochRightClick) {
Expand All @@ -998,8 +1005,11 @@ $(document).ready(function() {
var result = molochRightClick[key].url
.replace("%EXPRESSION%", encodeURIComponent(urlParams.expression))
.replace("%DATE%", dateparams)
.replace("%ISOSTART%", isostart.toISOString())
.replace("%ISOSTOP%", isostop.toISOString())
.replace("%FIELD%", info.field)
.replace("%TEXT%", text)
.replace("%UCTEXT%", text.toUpperCase())
.replace("%HOST%", host)
.replace("%URL%", encodeURIComponent("http:" + url));

Expand Down

0 comments on commit 4ec0293

Please sign in to comment.