@@ -4442,12 +4442,16 @@ uint8_t* sinsp_filter_check_event::extract(sinsp_evt *evt, OUT uint32_t* len, bo
4442
4442
vector<string> subelements = sinsp_split (e, ' :' );
4443
4443
ASSERT (subelements.size () == 2 );
4444
4444
m_strstorage = trim (subelements[1 ]);
4445
+ if (m_strstorage.length () > 12 )
4446
+ {
4447
+ m_strstorage = m_strstorage.substr (0 , 12 );
4448
+ }
4445
4449
RETURN_EXTRACT_STRING (m_strstorage);
4446
4450
}
4447
4451
}
4448
4452
else if (m_field_id == TYPE_INFRA_DOCKER_CONTAINER_NAME)
4449
4453
{
4450
- if (e.substr (0 , sizeof (" Name " ) - 1 ) == " Name " )
4454
+ if (e.substr (0 , sizeof (" name " ) - 1 ) == " name " )
4451
4455
{
4452
4456
vector<string> subelements = sinsp_split (e, ' :' );
4453
4457
ASSERT (subelements.size () == 2 );
@@ -4461,7 +4465,17 @@ uint8_t* sinsp_filter_check_event::extract(sinsp_evt *evt, OUT uint32_t* len, bo
4461
4465
{
4462
4466
vector<string> subelements = sinsp_split (e, ' :' );
4463
4467
ASSERT (subelements.size () == 2 );
4464
- m_strstorage = trim (subelements[1 ]);
4468
+ m_strstorage = subelements[1 ];
4469
+
4470
+ if (m_strstorage.find (" @" ) != string::npos)
4471
+ {
4472
+ m_strstorage = m_strstorage.substr (0 , m_strstorage.find (" @" ));
4473
+ }
4474
+ else if (m_strstorage.find (" sha256" ) != string::npos)
4475
+ {
4476
+ m_strstorage = e.substr (e.find (" :" ) + 1 );
4477
+ }
4478
+ m_strstorage = trim (m_strstorage);
4465
4479
RETURN_EXTRACT_STRING (m_strstorage);
4466
4480
}
4467
4481
}
0 commit comments