<?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: JSON Transformation in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/JSON-Transformation/m-p/536255#M89902</link>
    <description>&lt;P&gt;to4kawa,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help! Just to make sure I am understanding this correctly, the code block should go into the props.conf as well as the second bit. Is that right, or am I misinterpreting your statement? I just haven't previously seen eval as an option that is ran at index and I figured it would be best to double-check before proceeding blindly on my end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jan 2021 19:28:01 GMT</pubDate>
    <dc:creator>willryals</dc:creator>
    <dc:date>2021-01-18T19:28:01Z</dc:date>
    <item>
      <title>JSON Transformation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-Transformation/m-p/535388#M89794</link>
      <description>&lt;P&gt;Hi guys,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I have a multi array json input. What I am looking to do is have it split the initial raw data into seperate JSON events.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EX:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"response": {&lt;BR /&gt;"method": "switchvox.callQueues.getCurrentStatus",&lt;BR /&gt;"result": {&lt;BR /&gt;"call_queue": {&lt;BR /&gt;"extension": "2070",&lt;BR /&gt;"strategy": "ring_all",&lt;BR /&gt;"queue_members": {&lt;BR /&gt;"queue_member": [&lt;BR /&gt;{&lt;BR /&gt;"paused_time": "1626",&lt;BR /&gt;"completed_calls": "1",&lt;BR /&gt;"paused_since": "2021-01-08 08:59:28",&lt;BR /&gt;"talking_to_name": "",&lt;BR /&gt;"login_type": "login",&lt;BR /&gt;"order": "1",&lt;BR /&gt;"login_time": "7265",&lt;BR /&gt;"extension": "4826",&lt;BR /&gt;"max_talk_time": "835",&lt;BR /&gt;"time_of_last_call": "2021-01-08 08:26:32",&lt;BR /&gt;"paused": "1",&lt;BR /&gt;"account_id": "1503",&lt;BR /&gt;"missed_calls": "0",&lt;BR /&gt;"logged_in_status": "logged_in",&lt;BR /&gt;"fullname": "",&lt;BR /&gt;"talking_to_number": "",&lt;BR /&gt;"avg_talk_time": "835"&lt;BR /&gt;},&lt;BR /&gt;{&lt;BR /&gt;"paused_time": "773",&lt;BR /&gt;"completed_calls": "1",&lt;BR /&gt;"paused_since": "",&lt;BR /&gt;"talking_to_name": "",&lt;BR /&gt;"login_type": "login",&lt;BR /&gt;"order": "2",&lt;BR /&gt;"login_time": "3713",&lt;BR /&gt;"extension": "4824",&lt;BR /&gt;"max_talk_time": "183",&lt;BR /&gt;"time_of_last_call": "2021-01-08 08:13:34",&lt;BR /&gt;"paused": "0",&lt;BR /&gt;"account_id": "1587",&lt;BR /&gt;"missed_calls": "1",&lt;BR /&gt;"logged_in_status": "logged_in",&lt;BR /&gt;"fullname": "",&lt;BR /&gt;"talking_to_number": "",&lt;BR /&gt;"avg_talk_time": "183"&lt;BR /&gt;},&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"paused_time": "1626",&lt;BR /&gt;"completed_calls": "1",&lt;BR /&gt;"paused_since": "2021-01-08 08:59:28",&lt;BR /&gt;"talking_to_name": "",&lt;BR /&gt;"login_type": "login",&lt;BR /&gt;"order": "1",&lt;BR /&gt;"login_time": "7265",&lt;BR /&gt;"extension": "4826",&lt;BR /&gt;"max_talk_time": "835",&lt;BR /&gt;"time_of_last_call": "2021-01-08 08:26:32",&lt;BR /&gt;"paused": "1",&lt;BR /&gt;"account_id": "1503",&lt;BR /&gt;"missed_calls": "0",&lt;BR /&gt;"logged_in_status": "logged_in",&lt;BR /&gt;"fullname": "",&lt;BR /&gt;"talking_to_number": "",&lt;BR /&gt;"avg_talk_time": "835"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;and&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"paused_time": "773",&lt;BR /&gt;"completed_calls": "1",&lt;BR /&gt;"paused_since": "",&lt;BR /&gt;"talking_to_name": "",&lt;BR /&gt;"login_type": "login",&lt;BR /&gt;"order": "2",&lt;BR /&gt;"login_time": "3713",&lt;BR /&gt;"extension": "4824",&lt;BR /&gt;"max_talk_time": "183",&lt;BR /&gt;"time_of_last_call": "2021-01-08 08:13:34",&lt;BR /&gt;"paused": "0",&lt;BR /&gt;"account_id": "1587",&lt;BR /&gt;"missed_calls": "1",&lt;BR /&gt;"logged_in_status": "logged_in",&lt;BR /&gt;"fullname": "",&lt;BR /&gt;"talking_to_number": "",&lt;BR /&gt;"avg_talk_time": "183"&lt;BR /&gt;},&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I need to use a transformation so this happens at indexing, but I am not sure how to do it while making sure Splunk still processes the resultant data and JSON.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 18:59:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-Transformation/m-p/535388#M89794</guid>
      <dc:creator>willryals</dc:creator>
      <dc:date>2021-01-11T18:59:09Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Transformation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-Transformation/m-p/536097#M89880</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=_internal | head 1 | fields _raw
| eval _raw="{\"response\":{\"method\":\"switchvox.callQueues.getCurrentStatus\",\"result\":{\"call_queue\":{\"extension\":\"2070\",\"strategy\":\"ring_all\",\"queue_members\":{\"queue_member\":[{\"paused_time\":\"1626\",\"completed_calls\":\"1\",\"paused_since\":\"2021-01-08 08:59:28\",\"talking_to_name\":\"\",\"login_type\":\"login\",\"order\":\"1\",\"login_time\":\"7265\",\"extension\":\"4826\",\"max_talk_time\":\"835\",\"time_of_last_call\":\"2021-01-08 08:26:32\",\"paused\":\"1\",\"account_id\":\"1503\",\"missed_calls\":\"0\",\"logged_in_status\":\"logged_in\",\"fullname\":\"\",\"talking_to_number\":\"\",\"avg_talk_time\":\"835\"},{\"paused_time\":\"773\",\"completed_calls\":\"1\",\"paused_since\":\"\",\"talking_to_name\":\"\",\"login_type\":\"login\",\"order\":\"2\",\"login_time\":\"3713\",\"extension\":\"4824\",\"max_talk_time\":\"183\",\"time_of_last_call\":\"2021-01-08 08:13:34\",\"paused\":\"0\",\"account_id\":\"1587\",\"missed_calls\":\"1\",\"logged_in_status\":\"logged_in\",\"fullname\":\"\",\"talking_to_number\":\"\",\"avg_talk_time\":\"183\"}]}}}}}"
| rex mode=sed "s/.*\[// s/\].*// s/(,)(?=\{\"paused_time)/#/g"
| eval _raw=split(_raw,"#")
| stats count by _raw
| spath&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;props.conf:&lt;/P&gt;&lt;P&gt;SEDCMD-trim =&amp;nbsp;s/.*\[// s/\].*//&lt;BR /&gt;LINE_BREAKER = (,)\{\"paused_time&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2021 02:01:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-Transformation/m-p/536097#M89880</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2021-01-16T02:01:52Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Transformation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-Transformation/m-p/536255#M89902</link>
      <description>&lt;P&gt;to4kawa,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help! Just to make sure I am understanding this correctly, the code block should go into the props.conf as well as the second bit. Is that right, or am I misinterpreting your statement? I just haven't previously seen eval as an option that is ran at index and I figured it would be best to double-check before proceeding blindly on my end.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 19:28:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-Transformation/m-p/536255#M89902</guid>
      <dc:creator>willryals</dc:creator>
      <dc:date>2021-01-18T19:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: JSON Transformation</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/JSON-Transformation/m-p/536269#M89905</link>
      <description>&lt;P&gt;I'm writing the example because the search results are easy to understand as a test of props.conf.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;| rex mode=sed "s/.*\[// s/\].*// s/(,)(?=\{\"paused_time)/#/g"&lt;BR /&gt;→　&lt;SPAN&gt;SEDCMD-trim =&amp;nbsp;s/.*\[// s/\].*// &lt;/SPAN&gt;&lt;/STRONG&gt;and&amp;nbsp;&lt;STRONG&gt;LINE_BREAKER = (,)\{\"paused_time&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;It's hard to understand LINE_BREAKER, but you can specify the part you want to split with a regular expression. Here's the &lt;STRONG&gt;#&lt;/STRONG&gt; and &lt;STRONG&gt;(,)&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;The behavior is a little different between rex and LINE_BREAKER, so the way I write it is also different.&lt;/P&gt;&lt;P&gt;e.g. [my blog _ english translated](&lt;A href="https://qiita.com/toshikawa/items/062000fba552258d5289#propsconf%E3%81%AB%E3%81%8A%E3%81%91%E3%82%8Bline_breaker%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6" target="_blank"&gt;https://qiita.com/toshikawa/items/062000fba552258d5289#propsconf%E3%81%AB%E3%81%8A%E3%81%91%E3%82%8Bline_breaker%E3%81%AB%E3%81%A4%E3%81%84%E3%81%A6&lt;/A&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 22:51:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/JSON-Transformation/m-p/536269#M89905</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2021-01-18T22:51:52Z</dc:date>
    </item>
  </channel>
</rss>

