title: Why are CloudWatch Logs sent from my Windows EC2 Instance not showing up on AWS Console?
body: <p>I have set up CloudWatch Logs on ec2 windows server-R2 but it doesn't show up on the AWS console. (My IAM user has FullAccess)
  <a href="https://aws.amazon.com/blogs/devops/using-cloudwatch-logs-with-amazon-ec2-running-microsoft-windows-server/" rel="nofollow noreferrer">https://aws.amazon.com/blogs/devops/using-cloudwatch-logs-with-amazon-ec2-running-microsoft-windows-server/</a></p>
  
  <p>My CloudWatch json file looks like below:</p>
  
  <pre><code>{
    "EngineConfiguration": {
      "PollInterval": "00:00:15",
      "Components": [
        {
          "Id": "ApplicationEventLog",
          "FullName": "AWS.EC2.Windows.CloudWatch.EventLog.EventLogInputComponent,AWS.EC2.Windows.CloudWatch",
          "Parameters": {
            "LogName": "Application",
            "Levels": "1"
          }
        },
        {
          "Id": "SystemEventLog",
          "FullName": "AWS.EC2.Windows.CloudWatch.EventLog.EventLogInputComponent,AWS.EC2.Windows.CloudWatch",
          "Parameters": {
            "LogName": "System",
            "Levels": "7"
          }
        },
        {
          "Id": "SecurityEventLog",
          "FullName": "AWS.EC2.Windows.CloudWatch.EventLog.EventLogInputComponent,AWS.EC2.Windows.CloudWatch",
          "Parameters": {
            "LogName": "Security",
            "Levels": "7"
          }
        },
        {
          "Id": "ETW",
          "FullName": "AWS.EC2.Windows.CloudWatch.EventLog.EventLogInputComponent,AWS.EC2.Windows.CloudWatch",
          "Parameters": {
            "LogName": "Microsoft-Windows-WinINet/Analytic",
            "Levels": "7"
          }
        },
        {
          "Id": "IISLogs",
          "FullName": "AWS.EC2.Windows.CloudWatch.CustomLog.CustomLogInputComponent,AWS.EC2.Windows.CloudWatch",
          "Parameters": {
            "LogDirectoryPath": "C:\\inetpub\\logs\\LogFiles\\W3SVC1",
            "TimestampFormat": "yyyy-MM-dd HH:mm:ss",
            "Encoding": "UTF-8",
            "Filter": "",
            "CultureName": "en-US",
            "TimeZoneKind": "UTC",
            "LineCount": "3"
          }
        },
        {
          "Id": "CustomLogs",
          "FullName": "AWS.EC2.Windows.CloudWatch.CustomLog.CustomLogInputComponent,AWS.EC2.Windows.CloudWatch",
          "Parameters": {
            "LogDirectoryPath": "C:\\CustomLogs\\",
            "TimestampFormat": "MM/dd/yyyy HH:mm:ss",
            "Encoding": "UTF-8",
            "Filter": "",
            "CultureName": "en-US",
            "TimeZoneKind": "Local"
          }
        },
        {
          "Id": "PerformanceCounter",
          "FullName": "AWS.EC2.Windows.CloudWatch.PerformanceCounterComponent.PerformanceCounterInputComponent,AWS.EC2.Windows.CloudWatch",
          "Parameters": {
            "CategoryName": "Memory",
            "CounterName": "Available MBytes",
            "InstanceName": "",
            "MetricName": "Memory",
            "Unit": "Megabytes",
            "DimensionName": "",
            "DimensionValue": ""
          }
        },
        {
          "Id": "CloudWatchLogs",
          "FullName": "AWS.EC2.Windows.CloudWatch.CloudWatchLogsOutput,AWS.EC2.Windows.CloudWatch",
          "Parameters": {
            "AccessKey": "accesskey",
            "SecretKey": "secretkey",
            "Region": "eu-west-1",
            "LogGroup": "Default-Log-Group",
            "LogStream": "{instance_id}"
          }
        },
        {
          "Id": "CloudWatch",
          "FullName": "AWS.EC2.Windows.CloudWatch.CloudWatch.CloudWatchOutputComponent,AWS.EC2.Windows.CloudWatch",
          "Parameters": {
            "AccessKey": "accesskey",
            "SecretKey": "secretkey",
            "Region": "eu-west-1",
            "NameSpace": "Windows/Default"
          }
        }
      ],
      "Flows": {
        "Flows": [
          "(ApplicationEventLog,SystemEventLog),CloudWatchLogs",
          "PerformanceCounter,CloudWatch"
        ]
      }
    }
  }
  </code></pre>
  
  <p>As I found it also needs to install SSM to show it up on the AWS console?! I am doing the installation process of SSM based on this link:
  <a href="http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/managed-instances.html#install-managed-win" rel="nofollow noreferrer">http://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/managed-instances.html#install-managed-win</a></p>
  
  <p>But it can't download the file, the details are as followed:</p>
  
  <pre><code>PS C:\Program Files (x86)\AWS Tools\PowerShell\AWSPowerShell&gt; $dir = $env:TEMP + "\ssm"
  &gt; New-Item -ItemType directory -Path $dir
  &gt; cd $dir
  &gt; $username = admin
  &gt; $password = 1234
  &gt; $wc = New-Object System.Net.Networkcredential($username, $password)
  &gt; $wc.DownloadFile("https://amazon-ssm-region.s3.amazonaws.com/latest/windows_amd64/AmazonSSMAgentSetup.exe", $dir + "\AmazonSSMAgentSetup.exe")
  
  
  
  You cannot call a method on a null-valued expression.
  
  At line:1 char:1
  
  + $wc.DownloadFile("https://amazon-ssm-    region.s3.amazonaws.com/latest/windows_amd64 ...
  
  + 
  
    + CategoryInfo  : InvalidOperation: (:) [], RuntimeException
  
    + FullyQualifiedErrorId : InvokeMethodOnNull
  </code></pre>
  
  <p>Is there any idea what the problem is?</p>