<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to connect Apigee Edge to Splunk in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-connect-Apigee-Edge-to-Splunk/m-p/546923#M91065</link>
    <description>&lt;P&gt;Need help configuring a secure connection between Google Apigee Edge and Splunk.&amp;nbsp; What parameters need to be set on the Apigee end and how does one configure the Splunk side?&lt;/P&gt;&lt;P&gt;William&lt;/P&gt;</description>
    <pubDate>Tue, 06 Apr 2021 19:43:38 GMT</pubDate>
    <dc:creator>wswartz_splunk</dc:creator>
    <dc:date>2021-04-06T19:43:38Z</dc:date>
    <item>
      <title>How to connect Apigee Edge to Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-connect-Apigee-Edge-to-Splunk/m-p/546923#M91065</link>
      <description>&lt;P&gt;Need help configuring a secure connection between Google Apigee Edge and Splunk.&amp;nbsp; What parameters need to be set on the Apigee end and how does one configure the Splunk side?&lt;/P&gt;&lt;P&gt;William&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 19:43:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-connect-Apigee-Edge-to-Splunk/m-p/546923#M91065</guid>
      <dc:creator>wswartz_splunk</dc:creator>
      <dc:date>2021-04-06T19:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect Apigee Edge to Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-connect-Apigee-Edge-to-Splunk/m-p/546932#M91066</link>
      <description>&lt;P&gt;Good question, William.&amp;nbsp; Please see below:&lt;/P&gt;&lt;P&gt;Do a web search on the term, “apigee splunk,” and eventually you’ll end up here: &lt;A href="https://community.apigee.com/articles/13298/log-messages-into-splunk.html" target="_blank" rel="noopener"&gt;https://community.apigee.com/articles/13298/log-messages-into-splunk.html&lt;/A&gt; (I’ll refer to this as “the Article.”)&amp;nbsp; This Apigee Community page is a great place to start for information on configuring Apigee to work with Splunk.&amp;nbsp; It describes three methods of connecting -using Splunk’s HTTP Event Collector (HEC), using TCP, or using JavaScript.&amp;nbsp; I’ll cover the first two methods here.&amp;nbsp; While setting up HEC to work with Apigee is rather straightforward, and I’ll cover this briefly below, the TCP method is a bit trickier and requires some special configuration in Splunk.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option 1: HEC&lt;/P&gt;&lt;P&gt;Utilizing the HTTP Event Collector is by far the easiest method for connecting Apigee to Splunk.&amp;nbsp; The link for setting up HEC in the Article is no longer available but you can find the Splunk documentation here: &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.1.2/Data/UsetheHTTPEventCollector" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/8.1.2/Data/UsetheHTTPEventCollector&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Splunk configuration:&lt;/P&gt;&lt;P&gt;In summary, the following steps are required to set up an HEC token:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;On your receiving system (indexer or heavy forwarder), consider creating a new application and index to contain your Apigee config.&amp;nbsp; I created an app called Apigee along with a corresponding “apigee” index.&lt;/LI&gt;&lt;LI&gt;In the Splunk UI, go to Settings, Data Inputs.&lt;/LI&gt;&lt;LI&gt;Under Local Inputs, select HTTP Event Collector.&lt;/LI&gt;&lt;LI&gt;Click the Global Settings button and select Enable SSL to utilize HTTPS.&amp;nbsp; Also, make note of the HTTP Port Number.&amp;nbsp; The default is 8088 but can be changed as required. Click Save.&lt;/LI&gt;&lt;LI&gt;Back on the main HEC page, select New Token&lt;OL&gt;&lt;LI&gt;Give your token a name (I used “apigee).&amp;nbsp; Click Next.&lt;/LI&gt;&lt;LI&gt;On the Input Settings page, click Select and select the sourcetype as “_json.”&lt;/LI&gt;&lt;LI&gt;Select an App Context as appropriate.&lt;/LI&gt;&lt;LI&gt;Select an existing index to store the Apigee events – I used the index created above.&lt;/LI&gt;&lt;LI&gt;Click Review, review your settings, then click Submit.&lt;/LI&gt;&lt;LI&gt;Your HEC token will be displayed; make note of it.&amp;nbsp; You can also get the token from the Data Inputs, HTTP Event Collector page.&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Apigee configuration:&lt;/P&gt;&lt;P&gt;This assumes you have Apigee set up with a working API Proxy.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Go to Develop, API Proxies, and select the proxy you’d like to use.&lt;/LI&gt;&lt;LI&gt;Click the Develop tab.&lt;/LI&gt;&lt;LI&gt;Under the Navigator pane, select the “+” next to Policies to add a new policy.&lt;/LI&gt;&lt;LI&gt;A set of policies appears on the left.&amp;nbsp; Scroll to the bottom of the list and under the Extension section, select the Service Callout policy.&amp;nbsp; Enter a Display Name for the policy (I used “Splunk_HTTP”), select the HTTP radio button and enter the HTTP Target.&amp;nbsp; The target will be the publicly accessible IP address and port number for your HEC&amp;nbsp; - for instance: &lt;SPAN&gt;https:// 198.51.100.1:8088&lt;/SPAN&gt;.&amp;nbsp; Click Add.&lt;/LI&gt;&lt;LI&gt;Under the Code section of the policy, add the following lines (replace the line xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx with your HEC token):&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&amp;gt;
&amp;lt;ServiceCallout async="false" continueOnError="false" enabled="true" name="Splunk_HTTP"&amp;gt;
    &amp;lt;DisplayName&amp;gt;Splunk_HTTP&amp;lt;/DisplayName&amp;gt;
    &amp;lt;Properties/&amp;gt;
    &amp;lt;Request clearPayload="true" variable="myRequest"&amp;gt;
        &amp;lt;IgnoreUnresolvedVariables&amp;gt;false&amp;lt;/IgnoreUnresolvedVariables&amp;gt;
        &amp;lt;Set&amp;gt;
            &amp;lt;Headers&amp;gt;
                &amp;lt;Header name="Authorization"&amp;gt;Splunk xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx&amp;lt;/Header&amp;gt;
            &amp;lt;/Headers&amp;gt;
            &amp;lt;Payload contentType="application/json" variablePrefix="@" variableSuffix="#"&amp;gt;
                {"type": "apigee-log","status": "@message.status.code#"}
            &amp;lt;/Payload&amp;gt;
            &amp;lt;Path&amp;gt;services/collector/raw&amp;lt;/Path&amp;gt;
            &amp;lt;Verb&amp;gt;POST&amp;lt;/Verb&amp;gt;
        &amp;lt;/Set&amp;gt;
    &amp;lt;/Request&amp;gt;
    &amp;lt;Response&amp;gt;calloutResponse&amp;lt;/Response&amp;gt;
    &amp;lt;HTTPTargetConnection&amp;gt;
        &amp;lt;URL&amp;gt;https://198.51.100.1:8088&amp;lt;/URL&amp;gt;
    &amp;lt;/HTTPTargetConnection&amp;gt;
&amp;lt;/ServiceCallout&amp;gt;
​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a screenshot of the Apigee configuration:&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wswartz_splunk_0-1617738250055.png" style="width: 641px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13641iD59A41A16786097B/image-dimensions/641x353?v=v2" width="641" height="353" role="button" title="wswartz_splunk_0-1617738250055.png" alt="wswartz_splunk_0-1617738250055.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Notes:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;The Payload section is where you can customize what data is being sent to Splunk.&amp;nbsp; The Article shows a simple message to be sent: {"event":"Logged from EDGE"}.&amp;nbsp; This can be customized using Apigee Flow Variables.&amp;nbsp; In my example, I used the “message.status.code” flow variable to return the status code of the event.&amp;nbsp; More on flow variables may be found here: &lt;A href="https://docs.apigee.com/api-platform/reference/variables-reference#request" target="_blank" rel="noopener"&gt;https://docs.apigee.com/api-platform/reference/variables-reference#request&lt;/A&gt;.&lt;/LI&gt;&lt;LI&gt;For the URL, it is possible to change this to use an unsecure HTTP connection instead of HTTPS for testing purposes.&amp;nbsp; I found this valuable in diagnosing the connection as I could grab a packet capture from my firewall to see how the request was coming in.&amp;nbsp; If you would like to do this, make sure to uncheck the Enable SSL box in the HEC Global Settings.&amp;nbsp; Be sure to set it back when your testing is complete!&lt;/LI&gt;&lt;LI&gt;Finally, you need to add this policy to the flow.&amp;nbsp; For my example, I added the policy to the Proxy Endpoint PostFlow.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If all goes well, you should have a working connection.&amp;nbsp; When I access my API proxy, the following event is sent to Splunk:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wswartz_splunk_0-1617739014274.png" style="width: 516px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13642iA60AE87CC5C0A704/image-dimensions/516x129?v=v2" width="516" height="129" role="button" title="wswartz_splunk_0-1617739014274.png" alt="wswartz_splunk_0-1617739014274.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see, using HEC is pretty straightforward.&amp;nbsp; Now let’s set up Apigee to use a TCP connection from Apigee to Splunk.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option 2: TCP:&lt;/P&gt;&lt;P&gt;For this configuration, we’ll need to create a receive port in Splunk and add a new API policy in Apigee.&amp;nbsp; Let’s start with the Splunk configuration.&lt;/P&gt;&lt;P&gt;Splunk configuration:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;On your receiving system (indexer or heavy forwarder), as noted above, consider creating a new application and index to contain your Apigee config.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Add the following to an appropriate inputs.conf file.&amp;nbsp; This can be in your application or the main file located at $SPLUNK_HOME/etc/system/local:&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[tcp-ssl://6514]
index = apigee
 
[SSL]
serverCert = /opt/splunk/etc/auth/server.pem
sslPassword = password
​&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Note: The above example utilizes the internal Splunk self-signed certificate, the password of which is simply “password.”&amp;nbsp; While this may be fine for testing, it is recommended you utilize a signed certificate or a self-signed certificate that you create.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Details on inputs.conf may be found here: &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf&lt;/A&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;3. Restart Splunk for the new TCP input to take effect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apigee configuration:&lt;/P&gt;&lt;P&gt;In your API proxy&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Go to Develop, API Proxies, and select the proxy you’d like to use.&lt;/LI&gt;&lt;LI&gt;Click the Develop tab.&lt;/LI&gt;&lt;LI&gt;Under the Navigator pane, select the “+” next to Policies to add a new policy.&lt;/LI&gt;&lt;LI&gt;A set of policies appears on the left.&amp;nbsp; Scroll to the bottom of the list.&amp;nbsp; This time we’re going to select the Message Logging extension.&amp;nbsp; Enter a Display Name for the policy (I used “Splunk_TCP”).&amp;nbsp; This will create a default Message Logging template that we will need to adjust.&amp;nbsp; Change the &amp;lt;Host&amp;gt; and &amp;lt;Port&amp;gt; sections to suit your config.&amp;nbsp; The &amp;lt;Message&amp;gt; section can contain any text, including Flow Variables (see example below).&lt;/LI&gt;&lt;LI&gt;Finally, you need to add this policy to the flow.&amp;nbsp; For my example, I added the policy to the Proxy Endpoint PostFlow.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;BR /&gt;Here’s what the finished config should look like:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wswartz_splunk_1-1617739106731.png" style="width: 704px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13643i3D3B101D71AA7068/image-dimensions/704x322?v=v2" width="704" height="322" role="button" title="wswartz_splunk_1-1617739106731.png" alt="wswartz_splunk_1-1617739106731.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Once I access my API, the following event is sent to Splunk:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="wswartz_splunk_2-1617739129335.png" style="width: 617px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/13644iB4E174007D023D0F/image-dimensions/617x79?v=v2" width="617" height="79" role="button" title="wswartz_splunk_2-1617739129335.png" alt="wswartz_splunk_2-1617739129335.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;That’s it!&amp;nbsp; I hope this was helpful for anyone wanting to integrate Apigee with Splunk.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Apr 2021 20:12:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-connect-Apigee-Edge-to-Splunk/m-p/546932#M91066</guid>
      <dc:creator>wswartz_splunk</dc:creator>
      <dc:date>2021-04-06T20:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect Apigee Edge to Splunk</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-connect-Apigee-Edge-to-Splunk/m-p/702907#M116252</link>
      <description>&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;P&gt;In &lt;EM&gt;Truck Simulator Ultimate&lt;/EM&gt;, connecting platforms like Apigee Edge to Splunk is similar to integrating tracking tools for your fleet. This connection allows you to monitor and analyze API traffic data in real-time, just as tracking fuel and route efficiency improves logistics. It’s a powerful way to optimize operations smoothly. &lt;A href="http://trucksimulatorultimateplay.com/category/blog-posts/" target="_self"&gt;See More&lt;/A&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 27 Oct 2024 18:55:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-connect-Apigee-Edge-to-Splunk/m-p/702907#M116252</guid>
      <dc:creator>micheal</dc:creator>
      <dc:date>2024-10-27T18:55:27Z</dc:date>
    </item>
  </channel>
</rss>

