title: Get MQTT Topic name coming from AWS IOT CORE to AWS Lambda .Net Core
body: <p>i need an help.
  So i need to get from AWS Lambda the topic name subscribed (triggered) from AWS IOT CORE.
  So this is my code of lambda:</p>
  <pre><code>        public string FunctionHandler(Gps message, ILambdaContext context)
      { 
          LambdaLogger.Log(&quot;STRING MESSAGE DT: &quot; + message.dt);
          LambdaLogger.Log(&quot;STRING MESSAGE LN: &quot; + message.ln);
          LambdaLogger.Log(&quot;STRING MESSAGE LT: &quot; + message.lt);
          LambdaLogger.Log(&quot;input context: &quot; + context.FunctionName);
          LambdaLogger.Log(&quot;input context: &quot; + context.Identity);
          LambdaLogger.Log(&quot;input context: &quot; + context.InvokedFunctionArn);
          LambdaLogger.Log(&quot;input context: &quot; + context.FunctionName);
          LambdaLogger.Log(&quot;input context: &quot; + context.AwsRequestId);
          LambdaLogger.Log(&quot;input context: &quot; + context.ClientContext);
          LambdaLogger.Log(&quot;input context: &quot; + context.Logger);
          LambdaLogger.Log(&quot;input context: &quot; + context.LogStreamName);
          return JsonConvert.SerializeObject(gpsList);
      }
  </code></pre>
  <p>i saw in cloud watch, i received correctly the payload data from MQTT and triggered correctrly.
  So this is my topic:</p>
  <pre><code>AWS/#
  </code></pre>
  <p>this is my payload (geolocations object json) publish on <code>AWS/Test</code></p>
  <pre><code>{
          &quot;dt&quot;: &quot;2020-02-26 18:03:30&quot;,
          &quot;lt&quot;: &quot;xxx.xxx&quot;,
          &quot;ln&quot;: &quot;yyy.yyy&quot;
  }
  </code></pre>
  <p>My aws iot core rule:</p>
  <pre><code>SELECT *, topic() as Topic FROM 'AWS/#'
  </code></pre>
  <p>this is my logs from AWS CloudWatch</p>
  <pre><code>2021-04-20T09:26:48.457+02:00   STRING MESSAGE DT: 2020-02-26 18:03:30
  
  2021-04-20T09:26:48.473+02:00   STRING MESSAGE LN: xxx.xxx
  
  2021-04-20T09:26:48.473+02:00   STRING MESSAGE LT: yyy.yyy
  </code></pre>
  <p>As you can see i received correctly all data but, i need to read the name of topic.
  I need to read in this case <code>AWS/Test</code></p>
  <p>I need because the topic will contain basic info like serials of machines, for example 'AWS/xyz'.
  How can i read the topic name and read 'xyz' from publish MQTT? i need to get Topic name in AWS Lambda.
  I can't insert the serial machine into payload, but only on the naming of publish topic.</p>