<?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 Re: How to parse field data with delimiter from dbxquery result? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-parse-field-data-with-delimiter-from-dbxquery-result/m-p/641900#M222363</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;My apology. Here's actually the format:&lt;BR /&gt;[&amp;nbsp; {"protocol":"value","port":"value","destIP":value}&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;{"protocol":"value","port":"value","destIP":value}&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {"protocol":"value","port":"value","destIP":value}&amp;nbsp;]&lt;BR /&gt;Note that value can be within bracket "value", can also be value (without quote)..&amp;nbsp; &amp;nbsp;this is just an example..&amp;nbsp; actual data has more key pair and more rows. Thanks&lt;BR /&gt;&lt;BR /&gt;Output needed:&lt;BR /&gt;protocol&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; Port&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp;Dest IP&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;TCP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp;22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp;10.10.10.1&lt;BR /&gt;&amp;nbsp; &amp;nbsp;UDP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp;53&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp;10.10.10.2&lt;BR /&gt;&amp;nbsp; &amp;nbsp;TCP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; 80&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp;10.10.10.3&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 May 2023 15:42:40 GMT</pubDate>
    <dc:creator>LearningGuy</dc:creator>
    <dc:date>2023-05-01T15:42:40Z</dc:date>
    <item>
      <title>How to parse field data with delimiter from dbxquery result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-parse-field-data-with-delimiter-from-dbxquery-result/m-p/641851#M222344</link>
      <description>&lt;P class="lia-align-left"&gt;how to parse field data with delimiter from dbxquery result?&lt;BR /&gt;For example:&amp;nbsp;Dbxquery result is&lt;BR /&gt;FW Rule name: DNS&lt;BR /&gt;FW Rule:&amp;nbsp; "protocol":udp","port:53","dest_IP:10.10.10.1","direction:ingress"&lt;BR /&gt;I would like to have a FW rule display in a separate table in dashboard&lt;BR /&gt;Dropdown menu: FW Rule: DNS&lt;BR /&gt;Protocol&amp;nbsp; &amp;nbsp;|&amp;nbsp; Port&amp;nbsp; | Dest IP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;| Direction&lt;BR /&gt;UDP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp;53&amp;nbsp; &amp;nbsp; | 10.10.10.1&amp;nbsp; &amp;nbsp;| Ingress&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 11:19:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-parse-field-data-with-delimiter-from-dbxquery-result/m-p/641851#M222344</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2023-05-01T11:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse field data with delimiter from dbxquery result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-parse-field-data-with-delimiter-from-dbxquery-result/m-p/641880#M222354</link>
      <description>&lt;P&gt;If "protocol":udp" contains an extra quotation mark before the colon then this SPL should do the job.&amp;nbsp; Otherwise, we may have to resort to &lt;FONT face="courier new,courier"&gt;rex&lt;/FONT&gt; commands.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;&amp;lt;your dhxquery command&amp;gt;&amp;gt;
| extract pairdelim=",\"", kvdelim=":"
| rename protocol as Protocol, port as Port, dest_IP as "Dest IP", direction as Direction
| table Protocol Port "Dest IP" Direction&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 01 May 2023 13:36:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-parse-field-data-with-delimiter-from-dbxquery-result/m-p/641880#M222354</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-05-01T13:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse field data with delimiter from dbxquery result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-parse-field-data-with-delimiter-from-dbxquery-result/m-p/641900#M222363</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;My apology. Here's actually the format:&lt;BR /&gt;[&amp;nbsp; {"protocol":"value","port":"value","destIP":value}&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;{"protocol":"value","port":"value","destIP":value}&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {"protocol":"value","port":"value","destIP":value}&amp;nbsp;]&lt;BR /&gt;Note that value can be within bracket "value", can also be value (without quote)..&amp;nbsp; &amp;nbsp;this is just an example..&amp;nbsp; actual data has more key pair and more rows. Thanks&lt;BR /&gt;&lt;BR /&gt;Output needed:&lt;BR /&gt;protocol&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; Port&amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp;Dest IP&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;TCP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp;22&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp;10.10.10.1&lt;BR /&gt;&amp;nbsp; &amp;nbsp;UDP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp;53&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp;10.10.10.2&lt;BR /&gt;&amp;nbsp; &amp;nbsp;TCP&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; |&amp;nbsp; &amp;nbsp; &amp;nbsp; 80&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;|&amp;nbsp; &amp;nbsp;10.10.10.3&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 May 2023 15:42:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-parse-field-data-with-delimiter-from-dbxquery-result/m-p/641900#M222363</guid>
      <dc:creator>LearningGuy</dc:creator>
      <dc:date>2023-05-01T15:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse field data with delimiter from dbxquery result?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-parse-field-data-with-delimiter-from-dbxquery-result/m-p/642018#M222402</link>
      <description>&lt;P&gt;See if this works better.&amp;nbsp; The sample event is not quite JSON so the JSON SPL commands won't work. That means parsing the event manually.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults 
| eval _raw="[  {\"protocol\":\"value\",\"port\":\"value\",\"destIP\":value}
{\"protocol\":\"value\",\"port\":\"value\",\"destIP\":value}
{\"protocol\":\"value\",\"port\":\"value\",\"destIP\":value} ]" 
``` Above creates test data.  Remove IRL ```
``` Strip off brackets and break at newlines ```
| eval data=split(trim(_raw,"][ "),"
")
``` Put each line in a different event ```
| mvexpand data
``` Extract fields ```
| rex field=data "protocol\":\"?(?&amp;lt;protocol&amp;gt;[^,\"}]+)"
| rex field=data "port\":\"?(?&amp;lt;Port&amp;gt;[^,\"}]+)"
| rex field=data "destIP\":\"?(?&amp;lt;destIP&amp;gt;[^,\"}]+)"
| rename destIP as "Dest IP"
| table protocol Port "Dest IP"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 15:13:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-parse-field-data-with-delimiter-from-dbxquery-result/m-p/642018#M222402</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-05-02T15:13:27Z</dc:date>
    </item>
  </channel>
</rss>

