<?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 do I view Webhook content in Splunk? in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/How-do-I-view-Webhook-content-in-Splunk/m-p/422479#M11199</link>
    <description>&lt;P&gt;We're struggling a bit with trying to use Webhooks instead of custom scripts in our alerts.  Just as a simple test, we've created an alert to generate a post to one of our systems and instead of the JSON, all we &lt;EM&gt;appear&lt;/EM&gt; to receive is "1".  Are there any suggestions regarding the best way to test the received data? Is there anywhere that the payload is logged on the search head?  I can see in the splunkd.log the event, but not the content...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10-10-2018 09:51:08.880 -0400 INFO  sendmodalert - action=webhook STDERR -  Sending POST request to url=https://redacted.supercool.address/test with size=5043 bytes payload
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The STDERR in there does raise my eyebrows.  &lt;/P&gt;

&lt;P&gt;Any guidance would be appreciated.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Oct 2018 17:35:59 GMT</pubDate>
    <dc:creator>BryanScovill</dc:creator>
    <dc:date>2018-10-10T17:35:59Z</dc:date>
    <item>
      <title>How do I view Webhook content in Splunk?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-I-view-Webhook-content-in-Splunk/m-p/422479#M11199</link>
      <description>&lt;P&gt;We're struggling a bit with trying to use Webhooks instead of custom scripts in our alerts.  Just as a simple test, we've created an alert to generate a post to one of our systems and instead of the JSON, all we &lt;EM&gt;appear&lt;/EM&gt; to receive is "1".  Are there any suggestions regarding the best way to test the received data? Is there anywhere that the payload is logged on the search head?  I can see in the splunkd.log the event, but not the content...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;10-10-2018 09:51:08.880 -0400 INFO  sendmodalert - action=webhook STDERR -  Sending POST request to url=https://redacted.supercool.address/test with size=5043 bytes payload
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The STDERR in there does raise my eyebrows.  &lt;/P&gt;

&lt;P&gt;Any guidance would be appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Oct 2018 17:35:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-I-view-Webhook-content-in-Splunk/m-p/422479#M11199</guid>
      <dc:creator>BryanScovill</dc:creator>
      <dc:date>2018-10-10T17:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I view Webhook content in Splunk?</title>
      <link>https://community.splunk.com/t5/Alerting/How-do-I-view-Webhook-content-in-Splunk/m-p/422480#M11200</link>
      <description>&lt;P&gt;Hi Bryan, &lt;/P&gt;

&lt;P&gt;One way to test connectivity is to use the webhook.site  as a test end point. That site will provide a url that you can POST to and see if it gets there.  Here is an example using curl. &lt;/P&gt;

&lt;P&gt;curl -X POST -H 'Content-Type: application/json' --data '{"username":"foo", "password":"bar"}' &lt;A href="https://webhook.site/40767741-9583-4cc6-8934-163ffab666ef" target="_blank"&gt;https://webhook.site/40767741-9583-4cc6-8934-163ffab666ef&lt;/A&gt;&lt;BR /&gt;
Nice Job!&lt;/P&gt;

&lt;P&gt;The URL was generated by the webhook.site which makes it easy to copy and paste as above. I set it up to return the Nice Job! result string.  I did nothing else other then that. &lt;/P&gt;

&lt;P&gt;On the webhook.site you will see the json data displayed along with some connectivity meta-data.  If the curl example works, then the same URL will work with an alert.  I tested it and conformed it. The json doc sent by the alert looks like this on the webhook site. &lt;/P&gt;

&lt;P&gt;I just pasted the URL into the form for creating a webhook in the Splunk UI. &lt;/P&gt;

&lt;P&gt;Here is the result shown at the URL endpoint on the webhook.site. &lt;/P&gt;

&lt;P&gt;{&lt;BR /&gt;
  "owner": "admin",&lt;BR /&gt;
  "app": "search",&lt;BR /&gt;
  "sid": "rt_scheduler_&lt;EM&gt;admin&lt;/EM&gt;&lt;EM&gt;search&lt;/EM&gt;&lt;EM&gt;RMD5c915be116e89b766_at_1539791034_150.118",&lt;BR /&gt;
  "search_name": "my_alertTest2",&lt;BR /&gt;
  "results_link": "&lt;A href="http://shd1:8000/app/search/@go?sid=rt_scheduler" target="_blank"&gt;http://shd1:8000/app/search/@go?sid=rt_scheduler&lt;/A&gt;&lt;/EM&gt;&lt;EM&gt;admin&lt;/EM&gt;&lt;EM&gt;search&lt;/EM&gt;&lt;EM&gt;RMD5c915be116e89b766_at_1539791034_150.118",&lt;BR /&gt;
  "result": {&lt;BR /&gt;
    "date_minute": "13",&lt;BR /&gt;
    "timestartpos": "0",&lt;BR /&gt;
    "_raw": "2018-10-17 18:13:13 127.0.0.2 22 127.0.0.12 2200 tomg 4624 - \"login success\" - - -",&lt;BR /&gt;
    "_serial": "2",&lt;BR /&gt;
    "_sourcetype": "mytransform:alerts",&lt;BR /&gt;
    "date_zone": "local",&lt;BR /&gt;
    "index": "alert_test",&lt;BR /&gt;
    "sourcetype": "mytransform:alerts",&lt;BR /&gt;
    "date_second": "13",&lt;BR /&gt;
    "date_month": "october",&lt;BR /&gt;
    "punct": "--&lt;/EM&gt;::&lt;EM&gt;...&lt;/EM&gt;&lt;EM&gt;...&lt;/EM&gt;__&lt;EM&gt;-&lt;/EM&gt;\"&lt;EM&gt;\"&lt;/EM&gt;-&lt;EM&gt;-&lt;/EM&gt;-",&lt;BR /&gt;
    "source": "/var/tmp/alert_sample.log",&lt;BR /&gt;
    "host": "ufd1",&lt;BR /&gt;
    "_confstr": "source::/var/tmp/alert_sample.log|host::ufd1|mytransform:alerts",&lt;BR /&gt;
    "date_hour": "18",&lt;BR /&gt;
    "date_wday": "wednesday",&lt;BR /&gt;
    "_kv": "1",&lt;BR /&gt;
    "_si": [&lt;BR /&gt;
      "idx1",&lt;BR /&gt;
      "alert_test"&lt;BR /&gt;
    ],&lt;BR /&gt;
    "date_mday": "17",&lt;BR /&gt;
    "_indextime": "1539799995",&lt;BR /&gt;
    "splunk_server": "idx1",&lt;BR /&gt;
    "date_year": "2018",&lt;BR /&gt;
    "_time": "1539799993",&lt;BR /&gt;
    "timeendpos": "20"&lt;BR /&gt;
  }&lt;BR /&gt;
}&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:42:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/How-do-I-view-Webhook-content-in-Splunk/m-p/422480#M11200</guid>
      <dc:creator>tgendron_splunk</dc:creator>
      <dc:date>2020-09-29T21:42:20Z</dc:date>
    </item>
  </channel>
</rss>

