Answers: <p>Follow these steps to fix <code>InvalidCiphertextException</code>:</p>
  <ol>
  <li><p>Open the Lambda function in AWS console.</p>
  </li>
  <li><p>Scroll down to the <code>Environment Variables</code> section &amp; click <code>Edit</code>:</p>
  </li>
  </ol>
  <p><a href="https://i.sstatic.net/pu6oz.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pu6oz.png" alt="enter image description here" /></a></p>
  <ol start="3">
  <li><p>Delete the value of <code>kmsEncryptedCustomerToken</code> &amp; replace it with the customer token you got from <code>https://&lt;your-company&gt;.loggly.com/tokens</code>. The token looks like this: <code>72cf6d64-256e-449d-aabd-49e1f422ed58</code>.</p>
  </li>
  <li><p>Expand the <code>Encryption Configuration</code> section at the bottom.</p>
  </li>
  <li><p>Select <code>Enable helpers for encryption in transit</code>.</p>
  </li>
  <li><p>Click the <code>Encrypt</code> button that appears next to <code>kmsEncryptedCustomerToken</code>.</p>
  </li>
  </ol>
  <p><a href="https://i.sstatic.net/27w55.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/27w55.png" alt="enter image description here" /></a></p>
  <ol start="7">
  <li><p>Select the <code>logglyCustomerToken</code> KMS key (CMK) &amp; <code>Encrypt</code>.</p>
  </li>
  <li><p>Finally, <code>Save</code> the environment variables.</p>
  </li>
  </ol>
  <p>The Lambda function test should succeed now. If you face any other issues or need a complete end-to-end screenshot-guided tutorial for the entire process of sending CloudWatch Logs to Loggly, please see <a href="https://harishkm.in/2020/07/16/send-amazon-cloudwatch-logs-to-solarwinds-loggly-using-an-aws-lambda-function/" rel="nofollow noreferrer">my blog post</a>.</p>
  
Answers: CC BY-SA 4.0
Answers: 2020-07-20T01:12:58.803Z
Answers: Thank you this worked, sorry for slow reply forgot to reply and mark accepted answer. :D
Answers: joshk132
Answers: CC BY-SA 4.0
Answers: 2020-07-16T13:00:12.280Z
Answers: 2020-07-16T13:00:12.280Z
Answers: Harish KM
Body: <p>I am trying to use the loggly Lambda blueprint to send cloudwatch logs to loggly. I am doing this because I have a bunch of lambdas that I need to have a single point of viewing logs. I've followed <a href="https://documentation.solarwinds.com/en/Success_Center/loggly/Content/admin/cloudwatch-logs.htm?cshid=loggly_cloudwatch-logs" rel="nofollow noreferrer">this guide</a> and have run into an issue when I check the lambda logs after a test</p>
  <p>Command used to do ciphertext</p>
  <pre><code>aws kms encrypt --key-id alias/logglyCustomerToken --plaintext &quot;&lt;my token&gt;&quot;
  </code></pre>
  <p>KMS key was created using symetric and default settings, can't delete key to try again or at least I don't know how to delete it and thinking I shouldn't change the code to match a new one</p>
  <p>Lambda log message when failed test</p>
  <pre><code>INFO    InvalidCiphertextException: null
      at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:51:27)
      at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
      at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
      at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:683:14)
      at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)
      at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)
      at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10
      at Request.&lt;anonymous&gt; (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)
      at Request.&lt;anonymous&gt; (/var/runtime/node_modules/aws-sdk/lib/request.js:685:12)
      at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {
    code: 'InvalidCiphertextException',
    time: 2020-07-08T02:48:55.536Z,
    requestId: 'cf0df165-5a59-4db0-beef-5d1ae3619c37',
    statusCode: 400,
    retryable: false,
    retryDelay: 79.27899980360486
  }
  </code></pre>
  
Comments: CC BY-SA 4.0
Comments: 2020-07-16T09:22:40.737Z
Comments: Also ask this question at [THWACK — The SolarWinds IT Community](https://thwack.solarwinds.com/t5/Loggly-Discussions/bd-p/loggly-discussions).
Comments: Harish KM
Tags: <amazon-web-services><aws-lambda><logging><amazon-cloudwatch><serverless>
Title: Unable to send cloudwatch logs to loggly using a blueprint lambda - Invalid ciphertext
UserDisplayName: joshk132
ThreadText: # Unable to send cloudwatch logs to loggly using a blueprint lambda - Invalid ciphertext
  
  (Asked by: username_0 on 2020-07-09)
  
  I am trying to use the loggly Lambda blueprint to send cloudwatch logs to loggly. I am doing this because I have a bunch of lambdas that I need to have a single point of viewing logs. I've followed [this guide](https://documentation.solarwinds.com/en/Success_Center/loggly/Content/admin/cloudwatch-logs.htm?cshid=loggly_cloudwatch-logs) and have run into an issue when I check the lambda logs after a test
  
  Command used to do ciphertext
  
  ```
  aws kms encrypt --key-id alias/logglyCustomerToken --plaintext "<my token>"
  
  ```
  
  KMS key was created using symetric and default settings, can't delete key to try again or at least I don't know how to delete it and thinking I shouldn't change the code to match a new one
  
  Lambda log message when failed test
  
  ```
  INFO    InvalidCiphertextException: null
      at Request.extractError (/var/runtime/node_modules/aws-sdk/lib/protocol/json.js:51:27)
      at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:106:20)
      at Request.emit (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:78:10)
      at Request.emit (/var/runtime/node_modules/aws-sdk/lib/request.js:683:14)
      at Request.transition (/var/runtime/node_modules/aws-sdk/lib/request.js:22:10)
      at AcceptorStateMachine.runTo (/var/runtime/node_modules/aws-sdk/lib/state_machine.js:14:12)
      at /var/runtime/node_modules/aws-sdk/lib/state_machine.js:26:10
      at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:38:9)
      at Request.<anonymous> (/var/runtime/node_modules/aws-sdk/lib/request.js:685:12)
      at Request.callListeners (/var/runtime/node_modules/aws-sdk/lib/sequential_executor.js:116:18) {
    code: 'InvalidCiphertextException',
    time: 2020-07-08T02:48:55.536Z,
    requestId: 'cf0df165-5a59-4db0-beef-5d1ae3619c37',
    statusCode: 400,
    retryable: false,
    retryDelay: 79.27899980360486
  }
  
  ```
  
  **Tags:** amazon-web-services, aws-lambda, logging, amazon-cloudwatch, serverless
  
  > **Comments:**
  > **username_1**: Also ask this question at [THWACK — The SolarWinds IT Community](https://thwack.solarwinds.com/t5/Loggly-Discussions/bd-p/loggly-discussions).  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-07-16. Score: 2 | Accepted answer
  
  Follow these steps to fix `InvalidCiphertextException`:
  
  1. Open the Lambda function in AWS console.
  2. Scroll down to the `Environment Variables` section & click `Edit`:
  
  [![enter image description here](https://i.sstatic.net/pu6oz.png)](https://i.sstatic.net/pu6oz.png)
  
  3. Delete the value of `kmsEncryptedCustomerToken` & replace it with the customer token you got from `https://<your-company>.loggly.com/tokens`. The token looks like this: `72cf6d64-256e-449d-aabd-49e1f422ed58`.
  4. Expand the `Encryption Configuration` section at the bottom.
  5. Select `Enable helpers for encryption in transit`.
  6. Click the `Encrypt` button that appears next to `kmsEncryptedCustomerToken`.
  
  [![enter image description here](https://i.sstatic.net/27w55.png)](https://i.sstatic.net/27w55.png)
  
  7. Select the `logglyCustomerToken` KMS key (CMK) & `Encrypt`.
  8. Finally, `Save` the environment variables.
  
  The Lambda function test should succeed now. If you face any other issues or need a complete end-to-end screenshot-guided tutorial for the entire process of sending CloudWatch Logs to Loggly, please see [my blog post](https://username_1.in/2020/07/16/send-amazon-cloudwatch-logs-to-solarwinds-loggly-using-an-aws-lambda-function/).
  
  > **Comments:**
  > **username_0**: Thank you this worked, sorry for slow reply forgot to reply and mark accepted answer. :D  
  
  ---
  
  