<?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 do you do a spath search that would search for multiple models with a variance of IOS levels? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-do-a-spath-search-that-would-search-for-multiple/m-p/386680#M69394</link>
    <description>&lt;P&gt;thank you!&lt;/P&gt;</description>
    <pubDate>Tue, 02 Apr 2019 18:04:26 GMT</pubDate>
    <dc:creator>bzsplunk54</dc:creator>
    <dc:date>2019-04-02T18:04:26Z</dc:date>
    <item>
      <title>How do you do a spath search that would search for multiple models with a variance of IOS levels?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-do-a-spath-search-that-would-search-for-multiple/m-p/386678#M69392</link>
      <description>&lt;P&gt;Hello,  &lt;/P&gt;

&lt;P&gt;I am trying to acquire some input for SPL parsing a JSON file using the &lt;CODE&gt;|spath&lt;/CODE&gt; command.  Here is an example of my JSON format.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
"ip": "10.1.1.2",
"hostname": "Switch_1",
"function": "Switch Access",
"owner": "Doughnut Co.",
"vendor": "Cisco",
"dev_type": "Switch",
"ssh": true,
"ping": true,
"snmp": false,
"ConnType": "cisco_ios",
"version": "15.2(2)E6",
"chassis_model": "WS-C2960",
"chassis_sn": "G0T1635R11M",
"slot_list": [
{
"sn": "G0T1635R11M",
"slot": "1",
"model": "WS-C2960"
}
],

{
"ip": "10.1.1.3",
"hostname": "Switch_2",
"function": "Switch Access",
"owner": "Doughnut Co.",
"vendor": "Cisco",
"dev_type": "Switch",
"ssh": true,
"ping": true,
"snmp": true,
"ConnType": "cisco_ios",
"version": "12.2(55)SE12",
"chassis_model": "WS-C2960S-48FPS-L",
"chassis_sn": "F0R1524Q11L",
"slot_list": [
{
"sn": "F0R1524Q11L",
"slot": "1",
"model": "WS-C2960S-48FPS-L"
}
],
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;==========================================================================&lt;BR /&gt;
I need to focus on the model (chassis_model) with a correlation to the IOS (version).   I know that I could add a spath statement and then a search statement for chassis_model and version, but how do I incorporate multiple searches for chassis_model and version.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Index=new dev_type=switch sourcetype="_json"  ("WS-C2960*") 
    ping!=false last_status="connected" earliest =-1d@d latest=now 
| spath version 
| search version="12.2(55)SE12"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to be able to search for multiple switch revisions of the same switch running different IOS versions.  This will work at the beginning of the search ** ("WS-C2960*" version="12.2(55)SE12") OR ("WS-C2960S*" version!="15.2(2)E6)**  However, I want to be able to use &lt;CODE&gt;spath&lt;/CODE&gt; as the search flow is easier to follow when dealing with a vast array of equipment.  &lt;/P&gt;

&lt;P&gt;*this I know will not work but how can something similar work with an spath SPL statement? &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| spath 
| search "WS-C2960S*" version!="15.2(2)E9" 
| spath 
| search "WS-C2960*" version="12.2(55)SE12" 
| dedup ip 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank You&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:55:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-do-a-spath-search-that-would-search-for-multiple/m-p/386678#M69392</guid>
      <dc:creator>bzsplunk54</dc:creator>
      <dc:date>2020-09-29T23:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do a spath search that would search for multiple models with a variance of IOS levels?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-do-a-spath-search-that-would-search-for-multiple/m-p/386679#M69393</link>
      <description>&lt;P&gt;Try using an OR clause in between:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | spath 
 | search (generatedField="WS-C2960S" version!="15.2(2)E9") OR (generatedField="WS-C2960*" version="12.2(55)SE12")
 | dedup ip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Spath should generate a field as well for that query, defining search based on field is much faster&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2019 19:22:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-do-a-spath-search-that-would-search-for-multiple/m-p/386679#M69393</guid>
      <dc:creator>martinpu</dc:creator>
      <dc:date>2019-04-01T19:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do a spath search that would search for multiple models with a variance of IOS levels?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-do-a-spath-search-that-would-search-for-multiple/m-p/386680#M69394</link>
      <description>&lt;P&gt;thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2019 18:04:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-do-a-spath-search-that-would-search-for-multiple/m-p/386680#M69394</guid>
      <dc:creator>bzsplunk54</dc:creator>
      <dc:date>2019-04-02T18:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do you do a spath search that would search for multiple models with a variance of IOS levels?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-you-do-a-spath-search-that-would-search-for-multiple/m-p/386681#M69395</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
Can we use regular expression in search field after spath ? I am stuck in the similar kind of situation. I retrieved JSON object, after that I am looking for a particular string with different formats (alphaNumeric). Those are actually data anomalies.&lt;BR /&gt;&lt;BR /&gt;
Could you please provide your advise on how do we incorporate regex in search field ? I tried, but could not come to the solution.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:21:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-you-do-a-spath-search-that-would-search-for-multiple/m-p/386681#M69395</guid>
      <dc:creator>asoma0707</dc:creator>
      <dc:date>2020-03-26T16:21:29Z</dc:date>
    </item>
  </channel>
</rss>

