<?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 split up a string into multiple fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551009#M156353</link>
    <description>&lt;P&gt;Can you separate out the field that has the json in, then spath on that field?&lt;/P&gt;</description>
    <pubDate>Sun, 09 May 2021 18:04:39 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-05-09T18:04:39Z</dc:date>
    <item>
      <title>How to split up a string into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551000#M156349</link>
      <description>&lt;P&gt;I have a field that consists of data separated from a json&amp;nbsp; data field using this search.&lt;/P&gt;&lt;P&gt;index="test-99" sourcetype="csv"&amp;nbsp;&amp;nbsp; | eval AuditData_keys = json_keys(AuditData)&amp;nbsp; ths works perfectly and creates the field called AuditData_keys&lt;/P&gt;&lt;P&gt;The data in field AuditData_keys in unique based on the values in a field called operations. There are 39 unique values, each with its own unique set of fields.&amp;nbsp; I'm trying to export each value of the operations field into distinct fields per value. My initial idea was to have individual eventtypes for each operations value. The issue I'm having is what is the best way to extract the fields as they contain similar fields as well as additional fields for each operation value.&lt;/P&gt;&lt;P&gt;I came up with this search to create a value for each value in the operations field and its relevant data fields.&lt;/P&gt;&lt;P&gt;index="test-99" sourcetype="csv" | eval AuditData_keys = json_keys(AuditData)| table Operations AuditData_keys | dedup AuditData_keys| outputcsv AuditData_extracted_fields_unique.csv&lt;/P&gt;&lt;P&gt;Here is a sample of one operation value and its fields.&lt;/P&gt;&lt;P&gt;Operation value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Values(fields)&amp;nbsp; from the AuditData_key&lt;/P&gt;&lt;TABLE width="242"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="174"&gt;UserLoginFailed&lt;/TD&gt;&lt;TD width="68"&gt;["CreationTime","Id","Operation","OrganizationId","RecordType","ResultStatus","UserKey","UserType","Version","Workload","ClientIP","ObjectId","UserId","AzureActiveDirectoryEventType","ExtendedProperties","ModifiedProperties","Actor","ActorContextId","ActorIpAddress","InterSystemsId","IntraSystemId","SupportTicketId","Target","TargetContextId","ApplicationId","DeviceProperties","ErrorNumber","LogonError"]&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Short of manually typing the fields for each operation value and using the strings command, there has to be a more efficient way.&lt;/P&gt;&lt;P&gt;This is o365 audit data extracted with powershell as a csv file that has embedded json data.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Robert&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>Sun, 09 May 2021 16:19:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551000#M156349</guid>
      <dc:creator>robayers</dc:creator>
      <dc:date>2021-05-09T16:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to split up a string into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551002#M156351</link>
      <description>&lt;P&gt;Can you not use spath to extract the json fields?&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 16:41:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551002#M156351</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-09T16:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to split up a string into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551008#M156352</link>
      <description>&lt;P&gt;That was unsuccessful at least on my attempts.&amp;nbsp; The majority&amp;nbsp; of the data is csv, except for a couple of fields which&amp;nbsp; are nested json.&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 17:59:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551008#M156352</guid>
      <dc:creator>robayers</dc:creator>
      <dc:date>2021-05-09T17:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to split up a string into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551009#M156353</link>
      <description>&lt;P&gt;Can you separate out the field that has the json in, then spath on that field?&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 18:04:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551009#M156353</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-09T18:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to split up a string into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551012#M156355</link>
      <description>&lt;P&gt;This search breaks it out, but there are also json fields that are nested in the results of the first spath command that also contain fields of data, such as these.&lt;/P&gt;&lt;P&gt;source="AuditLog_2021-03-01_2021-05-07.csv" host="DESKTOP-U34OQHV" index="test-99" sourcetype="csv" | spath input=AuditData&lt;/P&gt;&lt;P&gt;DeviceProperties{}.Name&lt;BR /&gt;DeviceProperties{}.Value&lt;BR /&gt;ExtendedProperties{}.Name&lt;BR /&gt;ExtendedProperties{}.Value&lt;BR /&gt;ModifiedProperties{}.Name&lt;BR /&gt;ModifiedProperties{}.NewValue&lt;BR /&gt;ModifiedProperties{}.OldValue&lt;BR /&gt;Target{}.ID Target{}.Type&lt;/P&gt;&lt;P&gt;On a side note, this is a process that will be repeated for quite a few o365 tenants, on a scheduled basis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 20:28:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551012#M156355</guid>
      <dc:creator>robayers</dc:creator>
      <dc:date>2021-05-09T20:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to split up a string into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551013#M156356</link>
      <description>&lt;P&gt;You could break out the collections from the json field, mvexpand to create separate event, then spath the collection field. It is unclear exactly what you are trying to achieve, which makes it difficult to give more specific advice.&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 21:23:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551013#M156356</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-09T21:23:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to split up a string into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551014#M156357</link>
      <description>&lt;P&gt;Ideally a repeatable process that does what you said, but the json extractions from the main field, AuditData and subsequent embedded json fields and their data can be performed on a scheduled basis.using an eventtype for each embedded json field&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 22:40:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551014#M156357</guid>
      <dc:creator>robayers</dc:creator>
      <dc:date>2021-05-09T22:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to split up a string into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551016#M156359</link>
      <description>&lt;P&gt;Ive created a regex on the regex101 site to detect all of the fields and put them in groups. Here is that regex,&lt;/P&gt;&lt;P&gt;\"(.[^\"]+)&lt;/P&gt;&lt;P&gt;This works and detects all of the fields and puts them in groups named automatically. I'd like to use the extracted data as the fieldname without all of the typing.&amp;nbsp; The regex above doesn't work in Splunk, or at least I&amp;nbsp; can't make it work.&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 00:20:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551016#M156359</guid>
      <dc:creator>robayers</dc:creator>
      <dc:date>2021-05-10T00:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to split up a string into multiple fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551017#M156360</link>
      <description>&lt;P&gt;Ideally something that&amp;nbsp; is repeatable, with options that are defined in a sourcetype while&amp;nbsp; importing the the downloaded csv. The imported file is downloaded on a scheduled basis.&lt;/P&gt;&lt;P&gt;Ive created a regex that works on the regex101 website,&amp;nbsp; \"(.[^\"]+)&lt;/P&gt;&lt;P&gt;This works and detects all of the fields and puts them in groups named automatically. I'd like to use the extracted data as the fieldname without all of the typing.&amp;nbsp; The regex above doesn't work in Splunk, or at least I&amp;nbsp; can't make it work.&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 00:27:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-split-up-a-string-into-multiple-fields/m-p/551017#M156360</guid>
      <dc:creator>robayers</dc:creator>
      <dc:date>2021-05-10T00:27:06Z</dc:date>
    </item>
  </channel>
</rss>

