static async getESTasks (req, res) {
    const options = ViewerUtils.addCluster(req.query.cluster);
    try {
      const { body: { tasks } } = await Db.tasks(options);

      let regex;
      if (req.query.filter !== undefined) {
        try {
          regex = new RE2(req.query.filter);
        } catch (e) {
          return res.serverError(500, `Regex Error: ${e}`);
        }
      }

      let rtasks = [];
      for (const key in tasks) {
        const task = tasks[key];

        task.taskId = key;
        if (task.children) {
          task.childrenCount = task.children.length;
        } else {
          task.childrenCount = 0;
        }
        delete task.children;

        if (req.query.cancellable && req.query.cancellable === 'true') {
          if (!task.cancellable) { continue; }
        }

        if (task.headers['X-Opaque-Id']) {
          const parts = ArkimeUtil.splitRemain(task.headers['X-Opaque-Id'], '::', 1);
          task.user = (parts.length === 1 ? '' : parts[0]);
        } else {
          task.user = '';
        }

        if (regex && (!task.action.match(regex) && !task.user.match(regex))) { continue; }

        rtasks.push(task);
      }

      const sortField = req.query.sortField || 'action';
      if (sortField === 'action' || sortField === 'user') {
        if (req.query.desc === 'true') {
          rtasks = rtasks.sort((a, b) => { return b.action.localeCompare(a.index); });
        } else {
          rtasks = rtasks.sort((a, b) => { return a.action.localeCompare(b.index); });
        }
      } else {
        if (req.query.desc === 'true') {
          rtasks = rtasks.sort((a, b) => { return b[sortField] - a[sortField]; });
        } else {
          rtasks = rtasks.sort((a, b) => { return a[sortField] - b[sortField]; });
        }
      }

      const size = parseInt(req.query.size) || 1000;
      if (rtasks.length > size) {
        rtasks = rtasks.slice(0, size);
      }

      return res.send({
        recordsTotal: Object.keys(tasks).length,
        recordsFiltered: rtasks.length,
        data: rtasks
      });
    } catch (err) {
      console.log(`ERROR - ${req.method} /api/estask`, util.inspect(err, false, 50));
      return res.send({
        data: [],
        recordsTotal: 0,
        recordsFiltered: 0
      });
    }
  }
GET - /api/estasks

Fetches OpenSearch/Elasticsearch tasks.
@name /estasks
@param {string} filter - Search text to filter the list of ES tasks by.
@param {string} cancellable=false - Whether to return only cancellable tasks. Default is "false".
@param {string} sortField=action - The field to sort the ES task list by.
@param {string} desc=false - Whether to return the results in descending order. Defaults to "false".
@param {number} size=1000 - The number of ES tasks to return. Defaults to 1000.
@returns {array} data - List of ES tasks with their corresponding stats.
@returns {number} recordsTotal - The total number of ES tasks.
@returns {number} recordsFiltered - The number of ES tasks returned in this result.