You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
5.3 KiB

<form script="topology.js" hideEdit="true" version="1.1">
<label>Topology - AWS</label>
<fieldset submitButton="false" autoRun="true">
<input type="multiselect" token="accountId" id="input1_all" searchWhenChanged="true">
<label>Account ID</label>
<default>*</default>
<choice value="*">All</choice>
<search>
<query>
<![CDATA[ |aclinputlookup all_account_ids | mvcombine delim=", " name | nomv name | eval title=account_id." (".name.")" ]]>
</query>
<earliest>0</earliest>
<latest>now</latest>
</search>
<fieldForValue>account_id</fieldForValue>
<fieldForLabel>title</fieldForLabel>
<prefix> (</prefix>
<suffix>) </suffix>
<valuePrefix>awsAccountId="</valuePrefix>
<valueSuffix>"</valueSuffix>
<delimiter> OR </delimiter>
</input>
<input type="multiselect" token="region" id="input2_all" searchWhenChanged="true">
<label>Regions</label>
<default>*</default>
<choice value="*">All</choice>
<search>
<query>
<![CDATA[ |inputlookup regions ]]>
</query>
<earliest>0</earliest>
<latest>now</latest>
</search>
<fieldForValue>region</fieldForValue>
<fieldForLabel>label</fieldForLabel>
<prefix>(awsRegion="global" OR </prefix>
<valuePrefix>awsRegion="</valuePrefix>
<valueSuffix>"</valueSuffix>
<delimiter> OR </delimiter>
<suffix>)</suffix>
</input>
<input type="dropdown" token="vpc" searchWhenChanged="true">
<label>VPC</label>
<default>*</default>
<choice value="*">All</choice>
<search>
<query>
<![CDATA[
`topology-daily-snapshot-index` resourceStatus!="ResourceDeleted" resourceId="vpc-*" AND $accountId$ AND $region$
| dedup resourceId
| eval expression="AND (resourceId=vol-* OR vpcId=".resourceId.")", fieldLabel=resourceId+" ("+resourceName+")"
]]>
</query>
<earliest>-7d</earliest>
<latest>now</latest>
</search>
<fieldForValue>expression</fieldForValue>
<fieldForLabel>fieldLabel</fieldForLabel>
</input>
<input type="dropdown" token="state" searchWhenChanged="true">
<label>Status of EC2 Instance</label>
<choice value="*">All</choice>
<choice value="running">Running</choice>
<choice value="stopped">Stopped</choice>
<choice value="terminated">Terminated</choice>
<choice value="shutting-down">Shutting down</choice>
<default>running</default>
<prefix>instanceStatus="</prefix>
<suffix>"</suffix>
</input>
<input id="awstags" token="tags">
</input>
<html id="timerange">
<label for="timepicker">Time</label>
<input type="text" id="timepicker"/>
</html>
</fieldset>
<search id="timeRangeSearch">
<query>
<![CDATA[
`topology-daily-snapshot-index` OR `topology-monthly-snapshot-index` resourceStatus!="ResourceDeleted" AND $accountId$ AND $region$ AND (resourceId!=i-* OR $state$) $vpc$
| stats min(_time) as minTime
]]>
</query>
<earliest>0</earliest>
<latest>now</latest>
</search>
<search id="topologySearch">
<query>
<![CDATA[
$topology_source_spl$
| append [search `aws-metadata-clb("","")`
| eval relationships=mvzip('instances{}.InstanceId', 'instances{}.State'), resourceType="AWS::EC2::LoadBalancer", resourceStatus="OK"
| eval vpcId=if(isnull(vpc_id), VPCId, vpc_id) | rename name as resourceName, AccountId as awsAccountId, region as awsRegion
| lookup regions region as awsRegion
| eval resourceId=resourceName+" ("+awsAccountId+", "+location+")"]
| dedup resourceId
| search resourceStatus!="ResourceDeleted" AND $accountId$ AND $region$ AND (resourceId!=i-* OR $state$) $vpc$
| lookup regions region as awsRegion
| rename location as awsRegion
| eval resourceName=if(resourceType=="AWS::ElasticLoadBalancingV2::LoadBalancer", resourceName+" ("+awsAccountId+", "+awsRegion+")", resourceName)
| fields resourceArn, relationships, tags, resourceStatus, instanceStatus, instanceType, publicIp, privateIp, vpcId , resourceId, resourceName, awsAccountId, awsRegion, resourceType, attachedPolicies, userPolicies, groupPolicies $tags|tag2topology$
]]>
</query>
<earliest>$earliest$</earliest>
<latest>$latest$</latest>
</search>
<row>
<panel>
<html id="topologyContainer">
<div id="aws-topology">
</div>
<canvas id="export_canvas"></canvas>
</html>
</panel>
</row>
</form>