GetServerURL

Get the Server URL.

javascript · Common Scripts

Source

  function parseUrl(url) {
      match = url.match(urlRegex);

      return match ? {
          shcema: url.match(/^(https?):/)[1],
          hostname: match[2],
          port: match[3] || '',
      } : null;
  }

  urls = demistoUrls();
  server_url = urls['server'].toString();


  result = parseUrl(server_url);

  ec = {
      'ServerURL': {
          Scheme: result.shcema,
          Host: result.hostname,
          Port: Number(result.port),
          URL: server_url
      }
  }

  return {
      Type: entryTypes.note,
      Contents: server_url,
      ContentsFormat: formats.note,
      HumanReadable: server_url,
      ReadableContentsFormat: formats.markdown,
      EntryContext: ec
  };

README

Get the Server URL.

Script Data


Name Description
Script Type javascript
Cortex XSOAR Version 5.0.0

Used In


This script is used in the following playbooks and scripts.

  • Add Unknown Indicators To Inventory - RiskIQ Digital Footprint
  • Content Update Check
  • Content Update Manager
  • Enrich Incident With Asset Details - RiskIQ Digital Footprint
  • IP Whitelist And Exclusion - RiskIQ Digital Footprint
  • NCSC CAF Assessment
  • PAN-OS to Cortex Data Lake Monitoring - Cron Job

Inputs


There are no inputs for this script.

Outputs


Path Description Type
ServerURL.Host The server host name. String
ServerURL.Port The server port. Number
ServerURL.Scheme The server scheme. String
ServerURL.URL The server full URL. String