title: Elastic Stack - REST API logging with full JSON request and response
body: <h2>Background</h2>
  
  <p>We have a web server written in Java that communicates with thousands of mobile apps via HTTPS REST APIs. </p>
  
  <p>For investigation purposes we have to log all API calls - currently this is implemented as a programming <code>@Aspect</code>, and for each API call we save an <code>api_call_log</code> object into a MySQL table with the following attributes:</p>
  
  <ul>
  <li><code>tenant_id</code></li>
  <li><code>username</code></li>
  <li><code>device_uuid</code></li>
  <li><code>api_method</code></li>
  <li><code>api_version</code></li>
  <li><code>api_start_time</code></li>
  <li><code>api_processing_duration</code></li>
  <li><code>request_parameters</code></li>
  <li><code>full_request</code> (JSON)</li>
  <li><code>full_response</code> (JSON)</li>
  <li><code>response_code</code></li>
  </ul>
  
  <h2>Problem</h2>
  
  <p>As you can imagine after reaching a certain throughput this solution doesn't scale well, and also querying this table is very slow even with the use of the right MySQL indices.</p>
  
  <h2>Approach</h2>
  
  <p>That's why we want to use the <strong>Elastic Stack</strong> to re-implement this solution, however I am a bit stuck at the moment. </p>
  
  <h2>Question</h2>
  
  <p>I couldn't found any Logstash plugins yet that would suit my needs - should I output this <code>api_call_log</code> object into a log file instead and use Logstash to parse, filter and transform that file?</p>